Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB VB.NET
Good Day,
 
I am so confused which is the best approach to get employee's (first time in) & (last time out) each day when they have login to our biometrics clock system.
 
For instance if "Jorge" has a schedule of 8am - 5pm on March 9, 2013
and he logged many times and has a record attendance of: time in at 10:10, 10:05, 10:15 and Time out at : 5:00. 5:30, 5:45
 
System should only gets "Jorge's" attendance for today like:
 
Time in: March 9, 2013 - 10:05 am & Time out: March 9, 2013 - 05:45 pm
 
Employee	Time Record	Type
Jorge	        3/9/2013 10:00	In
Jorge	        3/9/2013 10:10	In
Jorge	        3/9/2013 17:00	Out
Jorge	        3/9/2013 17:30	Out
Mike	        3/9/2013 17:40	Out
Jorge	        3/9/2013 10:02	In
Jorge	        3/9/2013 17:00	Out
Jorge	        3/9/2013 17:00	Out
Jorge	        3/9/2013 17:00	Out
Jorge	        3/9/2013 10:14	In
Mike	        3/9/2013 10:00	In
Mike	        3/9/2013 10:10	In
Jorge	        3/9/2013 17:00	Out
Mike	        3/9/2013 17:30	Out
Jorge	        3/9/2013 17:40	Out
Mike	        3/9/2013 10:02	In
Mike	        3/9/2013 17:00	Out
Mike	        3/9/2013 17:00	Out
Mike	        3/9/2013 17:00	Out
Jorge	        3/9/2013 10:14	In
Honestly i haven't tried any code because i am still thinking what is the best approach to get (first time in) & (last time out) for each employees attendance record on each day.
 
An idea from anyone would be very much helpful. thanks in advance.
 
[edit]Code block added - OriginalGriff[/edit]
Posted 9-Mar-13 5:42am
JMAM648
Edited 9-Mar-13 6:23am
v2
Comments
ThePhantomUpvoter at 9-Mar-13 11:29am
   
My first idea would to sit down and re-think what it is that you are doing. Why do allow people to clock in with clocking out? Why can they clock in multiple times? According to your sample Jorge clocks in a 10:00 but his start time is 10:05. He clocks out at 17:40 but his stop time is 17:45. How do you get that? The "best" approach is to get the clock out time and subtract the clock in time from it to get the total time.
JMAM at 9-Mar-13 11:35am
   
Because we have a biometrics device which still accepts time in even thoug employee had already done it. Likewise when you have punch it to traditional time clock using time card then once you have decided to re punch in at the same date.time clock will just over write the card.however on the device we can't modify this and what it does to simply insert new record.
 
Thanks for your advice btw.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Exactly how you do it is difficult to say, because you don't say how you are storing your data, and where you want to do this data checking.
 
For example, if it is in an SQL database and stored as dates, then its is a case of a simple SQL query to return the max and min value by group:
SELECT Employee,MAX(TimeRecord), MIN(TimeRecord) FROM myTable GROUP BY Employee
 
If you are storing it somewhere else, then we would need to know.
 
[edit]Typo: "say" for "don't" - OriginalGriff[/edit]
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 240
1 Kamal Rocks 184
2 CPallini 155
3 PIEBALDconsult 150
4 BillWoodruff 148
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 9 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100