Hours/minutes not covered by staff presence

kenpachi

New member
Local time
Yesterday, 19:37
Joined
Dec 18, 2008
Messages
6
I need some help here


The staff logs there presence in a table with the typical field like ID, date, "Start" and "End" last two fileds are hour value format.

I need to track which minutes of the day are not covered by the staff presence.

Do sombody got an idea how to do it ?

Thanks in advance
 
It'd be easier if the start and end were in the same field in the same table. Indicate a start record with a -1 and an end record with a +1, and lets call that value 'direction' Then sort on that single datetime field and traverse records, summing 'direction * datetime' until that sum is positive or zero. On that record the last person punched out and no one is there. And there's no one there until your 'direction * time' sum goes negative again. At that point someone has punched in.
Cheers,
 

Users who are viewing this thread

Back
Top Bottom