Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
My Table Below column Record Overtime_HHMM column only sum Total time in (time format)


Overtime_HHMM
02:59:00.0000000
01:58:00.0000000
01:18:00.0000000
04:08:00.0000000
00:39:00.0000000
00:22:00.0000000
02:01:00.0000000
00:36:00.0000000


I want This Overtime_HHMM total is :14:01:00:0000000
Posted
Comments
Kornfeld Eliyahu Peter 20-Oct-14 7:31am    
Convert it to milliseconds using DATEDIFF and use SUM on it...

1 solution

The below query might help.
VB
SELECT   SUM( DATEPART(SECOND, [Overtime_HHMM]) + 60 *
              DATEPART(MINUTE, [Overtime_HHMM]) + 3600 *
              DATEPART(HOUR, [Overtime_HHMM] )
            ) as 'TotTime'
FROM TableName
 
Share this answer
 

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