Time Interval / Duration BAQ E9.05

@Mi3kel @gpayne @Nancy_Hoyt,
i do not know if this will help to simplify what you want or not, and i have noticed that you are not taking into consideration the date change, and i think this is important when working on the LaborDtl table, so i created this SQL equation to calculate the difference in minutes time for each transaction between ClockInDateTime and CurrentDateTime, this one equation will take into consideration the different in days as well as time, and can be altered to any other time unit if you want and to any other date you want i.e. replace GETDATE() by any other date

DATEDIFF(day, LaborDtl.ClockInDate, GETDATE())*24*60+ DATEDIFF(minute, LaborDtl.DspClockInTime, FORMAT(getdate(), 'HH:mm:00'))

HTH

2 Likes