Jose Saiz

Jose Saiz

  • 1.5k
  • 260
  • 102.7k

Formula to calculate employee punched time hours

May 23 2014 6:33 PM

I have a table with 3 columns with multiple data row
EmpId , PUNCHED_IN_OUT Status
DOE001, 2014-05-23 9:56:01
DOE001, 2014-05-23 18:08:45
I've tried datediff(min,MIN(punched_in_out),MAX(punched_in_out))
the above rounds to 9 hours 
also this datediff(min,MIN(punched_in_out),MAX(punched_in_out)) % 60
different result

and this 18:07-9:56 result = 8:51 when the actual result should be 8:03

Please note that the subtracting the Last punched time minus the first punched time

does not work every time


Please help

Thanks



Answers (2)