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 int to hours

Author  Topic 

eugz
Posting Yak Master

210 Posts

Posted - 2009-06-19 : 15:28:30
Hi All.
The field AbsenceDays keep number of days like integer. How to conver that number to hours in format HHH:00?
Thanks.

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-06-19 : 15:39:05
select convert(varchar(10),AbsenceDays * 24)+':00'

Jim
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-20 : 02:40:50
Visakh, the issure here is days. What if days are 7?
When you convert with style 108, all you keep is the time part which would be 00:00:00.


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

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-06-20 : 02:59:35
ah! you're right
i missed it
i have removed my suggestion
Go to Top of Page

Jeff Moden
Aged Yak Warrior

652 Posts

Posted - 2009-06-21 : 18:55:16
eugz,
What are you going to do with that data now that you've got it converted?

--Jeff Moden
"Your lack of planning DOES constitute an emergency on my part... SO PLAN BETTER! "
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row"

For better, quicker answers, click on the following... [url]http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]
Go to Top of Page
   

- Advertisement -