Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: Samir H.
  Where is Samir H.?
 Yogyakarta
 Indonesia
 Samir H.
 Tags
Subject: RE: how to get attendance
Thread ID: 311023 Message ID: 311032 # Views: 43 # Ratings: 0
Version: Visual FoxPro 6 Category: Forms
Date: Tuesday, June 28, 2011 11:24:02 AM         
   


> >
> > We have been doing attendance type applications for years and I must say that it is not as easy as that sounds. What exactly are you asking? From experience:
> >
> > -Do not try to store in and out times as separate date and time values but datetime values.
> > -Do not try to make SQLs based directly on comparison of those datetime values (UNLESS the back end is not something like MS SQL Server - and if possible use MS SQL from the start)
> > -Although it may look strange (and if backend is something like MS SQL) consider having calculated columns storing the in-out times as seconds.
> > -Design well what would you do with records that are close enough to be not in-out but multiple entries of in or out (ie: card swiped N times thinking it is not read)
> >
> > and the list goes on. These are the ones that came to my mind at once. Maybe you should ask more specific questions.
> >
> > Cetin Basoz
> >
> > .Net has got better.Think about moving - check my blog:
> > My Blog
> > Blog (mirror) - sounds to be down
>
>
> Hi Cetin
> > -Although it may look strange (and if backend is something like MS SQL) consider having calculated columns storing the in-out times as seconds.
> Did you mean calculate it at the time of clock-in/out? I'm interested to know why, if you could give an example. Thanks.
>
> Regards
> Samir

A calculated column is something that is calculated from other persistent columns (and the calculated column itself could be persistent and indexed). I meant something like this:

InTime: datetime(2011,6,27, 10,15, 30)
OutTime: datetime(2011,6,27, 20,0,0)
FromSeconds: 36930 (this is calculated - column is a formula)
ToSeconds: 72000

If you keep aside the situation of having in and out on different dates (and you could also cover it if you store ticks instead) then those integer values serve as start-end points of a line (visualize). Including different dates it more looks like top-left and bottom-right of a rectangle and thus helps finding out overlapping times. Consider a tutor is on vacation between X1,Y1 and X2,Y2 (rectangle formed from datetimes) and a student wants to book an appointment with him on X3,Y3 (like a point in time - with duration a line). Is that time overlapping tutor's off time? You can make the calculation using datetimes directly but I found it easier using such integers (especially when the back end is VFP where you cannot compare datetime values directly).

Cetin Basoz

.Net has got better.Think about moving - check my blog:
My Blog
Blog (mirror) - sounds to be down

ENTIRE THREAD

how to get attendance Posted by SHAHERYAR RASHED @ 6/28/2011 10:23:06 AM
RE: how to get attendance Posted by Cetin Basoz @ 6/28/2011 10:45:30 AM
RE: how to get attendance Posted by Samir H. @ 6/28/2011 10:51:24 AM
RE: how to get attendance Posted by Cetin Basoz @ 6/28/2011 11:24:02 AM
RE: how to get attendance Posted by Samir H. @ 6/28/2011 2:06:37 PM
RE: how to get attendance Posted by Mike Gagnon @ 6/28/2011 12:01:06 PM