Click here to Skip to main content
15,886,422 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello

I have done total time for each month ..now i want to convert that time into hours per month...can anyone tell me how to convert time t hours in sql

this is code used for totaltime
SQL
CONVERT(TIME, DATEADD(s, SUM(( DATEPART(hh, date) * 3600 ) + ( DATEPART(mi, date) * 60 ) + DATEPART(ss, date)), 0)) AS totaltime


thank you
Posted
Updated 9-Nov-14 23:37pm
v2
Comments
King Fisher 10-Nov-14 5:38am    
Format your Code Before you Post. :)

1 solution

 
Share this answer
 
Comments
Member 11148509 11-Nov-14 3:20am    
Have tried that dint get the result....the code which i pasted is in select statementi want to change that to hours
thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900