forum

Home / DeveloperSection / Forums / How To Calculate Time Format Data In Sql?

How To Calculate Time Format Data In Sql?

Anonymous User197820-Oct-2014
My Table Below Record Overtime_HHMM column only sum Total time in (time format)


Table Structure is 
Overtime_HHMM  time(7)

ProcessDate    Overtime_HHMM
04 Mar 2014    02:59:00.0000000
05 Mar 2014    01:58:00.0000000
06 Mar 2014    01:18:00.0000000
07 Mar 2014    04:08:00.0000000
12 Mar 2014    00:39:00.0000000
13 Mar 2014    00:22:00.0000000
17 Mar 2014    02:01:00.0000000
22 Mar 2014    00:36:00.0000000
I want This Overtime_HHMM total is :14:01:00:0000000

My Query is
select sum(datediff(minute,'0:00:00',CONVERT(time,Overtime_HHMM)))/60.0 as TotalHoursWorked from Accounts_DailyAttendance where UserID='1050' and datename(month,processdate) ='March' and datepart(yyyy,processdate)= '2014' and LateIn > 5

I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By