G
Guest
OK, this one has been rattling my brains for a while now and i'm not sure how
to work this out.
Lets say i have a table with the following data
StaffRef DateTime Type
1 30/03/2005 08:02:54 IN
1 30/03/2005 10:03:04 OUT
1 30/03/2005 10:13:05 IN
1 30/03/2005 12:03:08 OUT
1 30/03/2005 12:34:28 IN
1 30/03/2005 17:00:07 OUT
2 30/03/2005 08:03:05 IN
2 30/03/2005 10:03:05 OUT
2 30/03/2005 10:12:08 IN
2 30/03/2005 12:04:12 OUT
2 30/03/2005 12:24:12 IN
2 30/03/2005 17:00:56 OUT
This says for 1 day (altho there will be many days) 2 members of staff have
signed in and out repeatedly (lunch, breaks, etc.). Basically i'm looking
for a way to find out how much time was taken as breaks/lunch, etc. for each
member of staff for that day. So we have starting time and ending time,
which i can find out myself using min and max. But How can i work out the
time difference between the OUTs and the INs before the end of the day, to
work out total time taken?
Any help on this would be appreciated.
Many thanks.
Phill
to work this out.
Lets say i have a table with the following data
StaffRef DateTime Type
1 30/03/2005 08:02:54 IN
1 30/03/2005 10:03:04 OUT
1 30/03/2005 10:13:05 IN
1 30/03/2005 12:03:08 OUT
1 30/03/2005 12:34:28 IN
1 30/03/2005 17:00:07 OUT
2 30/03/2005 08:03:05 IN
2 30/03/2005 10:03:05 OUT
2 30/03/2005 10:12:08 IN
2 30/03/2005 12:04:12 OUT
2 30/03/2005 12:24:12 IN
2 30/03/2005 17:00:56 OUT
This says for 1 day (altho there will be many days) 2 members of staff have
signed in and out repeatedly (lunch, breaks, etc.). Basically i'm looking
for a way to find out how much time was taken as breaks/lunch, etc. for each
member of staff for that day. So we have starting time and ending time,
which i can find out myself using min and max. But How can i work out the
time difference between the OUTs and the INs before the end of the day, to
work out total time taken?
Any help on this would be appreciated.
Many thanks.
Phill