Hi Everyone,
I need to calculate no of working hours per day
I have data as
StartTime EndTime
1900-01-01 07:00:00.000 1900-01-01 15:00:00.000
1900-01-01 15:00:00.000 1900-01-01 23:00:00.000
1900-01-01 23:00:00.000 1900-01-01 07:00:00.000
I have tried with below query
DATEDIFF(hour,convert(time,starttime,112),convert(time,EndTime,112))
i am getting
8
8
-16
I need to get 8 for third record too.Why i am getting -16??
Please help me to solve this
Thanks in advance.....