View Single Post
  #1  
Old March 3rd, 2006, 04:44 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Time and Attendance System Query

I am attempting to query a time and attendance database (Attendance
Enterprise by Infotronics) to determine the hours worked for any range of
time periods, classes of employees, shifts, etc.

While I am not entirely familiar with this database, it appears that in
order to get the most recent information, I need to use the "Transactions"
table, which has the following fields:
UNIQUEID
FILEKEY (identifies the employee)
DTTMSTAMP (date time stamp)
TRANSTYPE (actual punch or manual correction)
STATION (identifies the facility)
PERIOD (not populated)

A record is written every time an employee punches.

It appears that the only way to determine hours worked is to calculate time
elapsed between records.

In order to get total hours worked for a day (a day being defined as 7:00 am
to 7:00 am), here are the steps that I have come up with:
1) Pull a subset of data for the time period
2) Sort by FILEKEY, then DTTMSTAMP
3) Establish a new field called EMPTRANSNUM, which would number each
transaction for each employee
4) Make the assumption that the first transaction is an "in" punch.
5) Calculate time elapsed between transactions for each employee. For
example, a normal employee would have 4 transactions, "in" for the day, "out"
for lunch, "in" from lunch, and "out" for the day. So, the calculation for
this employee would be ((2-1) - (3-2) + (4-3))*24.

It is understood that missed punches make complete accuracy impossible.

My first question is, how do I populate the EMPTRANSNUM in step 3 above?

My second question is, am I missing something that would make this process
simpler?

Thanks.
--
Dan Young