Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 convert code

Author  Topic 

laith22
Starting Member

1 Post

Posted - 2008-11-06 : 03:22:46
I'm using this code :
select TRUNC (to_char(floor(:TOTAL))) || ':' ||TRUNC (to_char(mod(:TOTAL,1) * 60))
INTO xxxx
from dual;

if i use number 1.5 instead of :total ..it gives me 1:30 ... which is fine for me ...but if use number 5 instead of :total ..it gives me 5:0 and i want it with diffierent format like 5:00... thank you bro

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-11-06 : 03:27:49
Using ORACLE? Give it a try over at www.dbforums.com

Is 1.5 "One and a half minute" or "One and a half hour"?

SELECT CONVERT(CHAR(5), DATEADD(MINUTE, 60 * @theValue, 0), 108)



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2008-11-06 : 03:28:46
This is an SQL Server Forum.
Your posted query is not SQL Server.
What is it?

Webfred


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -