hmmmmmmmmmmmmmmmmmmmmm ... Still not really answering ALL the questions. I do not think it is a "good" idea to attempt to chart the attendance to the 'minute'. Most orgs go on at least a quarter hour basis, so I have cobbled together a rather crude approximation of a process:
I generated a pseudo time-ckock table for 50 pseudo employees for a month. The ONLY info in the table is:
EmpId as String [11](a pseudo SSN)
dtChkIn as Date
dtChkOut as Date
I populated the table with a In and out time for each EmpId for Each Date in my pseudo Month. This resultes in 1500 records (50 employees over 30 days). All [dtChkIn] items are restricted to between 7 and 10 AM, while [dtChkOut] is restricted to [dtChkIn] or 10 PM. This (obviously?) gives some rather strange work habits / scheduals - but suffuces to illustrate the approach. A BRIEF sample (a query Showing One Employee:
Code:
EmpId dtChkIn dtChkOut
136-14-1026 8/1/2004 8:25:13 AM 8/1/2004 2:19:44 PM
136-14-1026 8/2/2004 8:25:13 AM 8/2/2004 2:19:44 PM
136-14-1026 8/3/2004 8:25:13 AM 8/3/2004 2:19:44 PM
136-14-1026 8/4/2004 8:25:13 AM 8/4/2004 2:19:44 PM
136-14-1026 8/5/2004 8:25:13 AM 8/5/2004 2:19:44 PM
136-14-1026 8/6/2004 8:25:13 AM 8/6/2004 2:19:44 PM
136-14-1026 8/7/2004 8:25:13 AM 8/7/2004 2:19:44 PM
136-14-1026 8/8/2004 8:25:13 AM 8/8/2004 2:19:44 PM
136-14-1026 8/9/2004 8:25:13 AM 8/9/2004 2:19:44 PM
136-14-1026 8/10/2004 8:25:13 AM 8/10/2004 2:19:44 PM
136-14-1026 8/11/2004 8:25:13 AM 8/11/2004 2:19:44 PM
136-14-1026 8/12/2004 8:25:13 AM 8/12/2004 2:19:44 PM
136-14-1026 8/13/2004 8:25:13 AM 8/13/2004 2:19:44 PM
136-14-1026 8/14/2004 8:25:13 AM 8/14/2004 2:19:44 PM
136-14-1026 8/15/2004 8:25:13 AM 8/15/2004 2:19:44 PM
136-14-1026 8/16/2004 8:25:13 AM 8/16/2004 2:19:44 PM
136-14-1026 8/17/2004 8:25:13 AM 8/17/2004 2:19:44 PM
136-14-1026 8/18/2004 8:25:13 AM 8/18/2004 2:19:44 PM
136-14-1026 8/19/2004 8:25:13 AM 8/19/2004 2:19:44 PM
136-14-1026 8/20/2004 8:25:13 AM 8/20/2004 2:19:44 PM
136-14-1026 8/21/2004 8:25:13 AM 8/21/2004 2:19:44 PM
136-14-1026 8/22/2004 8:25:13 AM 8/22/2004 2:19:44 PM
136-14-1026 8/23/2004 8:25:13 AM 8/23/2004 2:19:44 PM
136-14-1026 8/24/2004 8:25:13 AM 8/24/2004 2:19:44 PM
136-14-1026 8/25/2004 8:25:13 AM 8/25/2004 2:19:44 PM
136-14-1026 8/26/2004 8:25:13 AM 8/26/2004 2:19:44 PM
136-14-1026 8/27/2004 8:25:13 AM 8/27/2004 2:19:44 PM
136-14-1026 8/28/2004 8:25:13 AM 8/28/2004 2:19:44 PM
136-14-1026 8/29/2004 8:25:13 AM 8/29/2004 2:19:44 PM
136-14-1026 8/30/2004 8:25:13 AM 8/30/2004 2:19:44 PM
136-14-1026 8/31/2004 8:25:13 AM 8/31/2004 2:19:44 PM
I then created a query:
Code:
SELECT tblTmClck.EmpId, Format([dtChkIn],"Short Date") AS MyDt, CLng(([dtChkIn]-CLng([dtChkIn]))*1440) AS TmIn, Partition([TmIn],420,1320,15) AS TimSlotIn, CLng(CDbl([dtChkOut]-Int([dtChkOut]))*1440) AS TmOut, Partition([TmOut],420,1320,15) AS TimSlotOut
FROM tblTmClck;
to 'redisplay' the information in a couple of different ways;
1)[tab]Isolate the DATE from the chkIn and chkout times (Format([dtChkIn],"Short Date") AS MyDt)
2)[tab]Calculate and display the Minute within the day (CLng(([dtChkIn]-CLng([dtChkIn]))*1440) AS TmIn) and the corresponding value for ChkOut
A3)[tab]nd Finally a
Partition function to capture the "time Slot" of the checkIn (and out) to the traditional 15 minute interval (Partition([TmIn],420,1320,15) AS TimSlotIn) as well as well as the coresponding Expression for ChkOut.
Again, a brief Sample for our selectd employee:
Code:
EmpId MyDt TmIn TimSlotIn TmOut TimSlotOut
136-14-1026 8/1/2004 505 495: 509 860 855: 869
136-14-1026 8/2/2004 505 495: 509 860 855: 869
136-14-1026 8/3/2004 505 495: 509 860 855: 869
136-14-1026 8/4/2004 505 495: 509 860 855: 869
136-14-1026 8/5/2004 505 495: 509 860 855: 869
136-14-1026 8/6/2004 505 495: 509 860 855: 869
136-14-1026 8/7/2004 505 495: 509 860 855: 869
136-14-1026 8/8/2004 505 495: 509 860 855: 869
136-14-1026 8/9/2004 505 495: 509 860 855: 869
136-14-1026 8/10/2004 505 495: 509 860 855: 869
136-14-1026 8/11/2004 505 495: 509 860 855: 869
136-14-1026 8/12/2004 505 495: 509 860 855: 869
136-14-1026 8/13/2004 505 495: 509 860 855: 869
136-14-1026 8/14/2004 505 495: 509 860 855: 869
136-14-1026 8/15/2004 505 495: 509 860 855: 869
136-14-1026 8/16/2004 505 495: 509 860 855: 869
136-14-1026 8/17/2004 505 495: 509 860 855: 869
136-14-1026 8/18/2004 505 495: 509 860 855: 869
136-14-1026 8/19/2004 505 495: 509 860 855: 869
136-14-1026 8/20/2004 505 495: 509 860 855: 869
136-14-1026 8/21/2004 505 495: 509 860 855: 869
136-14-1026 8/22/2004 505 495: 509 860 855: 869
136-14-1026 8/23/2004 505 495: 509 860 855: 869
136-14-1026 8/24/2004 505 495: 509 860 855: 869
136-14-1026 8/25/2004 505 495: 509 860 855: 869
136-14-1026 8/26/2004 505 495: 509 860 855: 869
136-14-1026 8/27/2004 505 495: 509 860 855: 869
136-14-1026 8/28/2004 505 495: 509 860 855: 869
136-14-1026 8/29/2004 505 495: 509 860 855: 869
136-14-1026 8/30/2004 505 495: 509 860 855: 869
136-14-1026 8/31/2004 505 495: 509 860 855: 869
4)[tab]Finally, a simple XTab Query (for me, based on the TimeSlot) shows the Attendance for each Date by Time Slot.
The data is badly generated and the results NOT what was requested, even for the limited information provided, but it is perhaps useful for those persuing the concept.
The Process produnces only thirty nine records of 34 columns, which could be used as the basis of an attendance chart. In particular, the use of the partition function (see the ubiquitoue
{F1} --- aka HELP for deatils, generates the time slots relatively painlessly, but is opnly available in recent versions of Ms. A. Better (more normally distribuited) data would certainly change the number of records, however this effect should not have a noticable impact on the performance of the process outlined here.
A more complete treatment, to more closely achieve the original goal would need to consider the chkIn and chkout times (or slots) in some additional detail, but is not conceptually difficult.
MichaelRed
mlred@verizon.net