[AccessD] Calculating Time Cards

Drew Wutka DWUTKA at marlow.com
Thu Jun 19 10:30:47 CDT 2003


Assuming you have a date/time in and a date/time out field, then this should
be pretty easy to do.

Build a query and have a field like this:

PayDate:
IIF(Hour([MyLoginDateTimeField])<7),DateSerial(Year([MyLogin...]),Month([MyL
ogin...]),Day([MyLogin..])-1,DateSerial(Year([MyLogin...]),Month([MyLogin...
]),Day([MyLogin..]))

Group by the new PayDate field (and your user field), then just sum the
differences between the login times and the logout times.  If you subtract
one date/time from another, as long as you don't go over 24 hours, you will
get the actual time spent.  (Just use the Hour() and Minute() function to
get the values you need.)

Drew

-----Original Message-----
From: Julie Reardon-Taylor [mailto:prosoft6 at hotmail.com]
Sent: Thursday, June 19, 2003 10:09 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] Calculating Time Cards


Hi Everyone,

Have a small problem that I'm hoping someone had encountered.  Putting 
together a small application to calculate time cards.  Running into some 
problems with the shift changes.  This manufacturing firm uses a 7:00 am to 
7:00 am day running three shifts.  I've found several examples for 
calculating time cards in the knowledge base, but none seem to address the 
fact the "third shift" runs from 11:00 pm to 3:00 am.  Of course, this means

that one hour of the shift occurs on one date, and the other seven hours 
occur on the following date.  I need to test the time input by the clerk and

then based on the start and end times, determine which shift the hours fall 
between, then calculate time worked on each shift for each employee.  
Employees may clock in and out more than once during a day, and may also 
work overtime, as well as spread their hours between more than one shift.  
Most of this is already written, however, I am stumpled as to how to handle 
the third shift time differential?



Julie Reardon-Taylor
PRO-SOFT OF NY, INC.
www.pro-soft.net

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list