Richard Collyer <mailto:[EMAIL PROTECTED]>
    on Monday, April 25, 2005 3:15 PM said:

> My idea of doing this was to have a database with each record being a
> day for a particular employee. Recording ID, Start Time, Finish Time
> in TimeStamp.

You need to tie those records to the employee records. You need a
foreign key in there somewhere. i.e. employee_id.

Also, by "day" you don't mean Monday, Tuesday, Wednesday, etc. right?
What I'm getting at is, a record should be created only when an employee
"logs in" and not for each day of the week. Don't create empty records
for each day the employee does not work.

> So I could then do a search for the number of employees whose shift
> start or finished in that particular day. If there is a start and a
> finish left add up the hours, if only a start do start -> midnight and
> if only a finish do midnight -> finish.
> 
> Is this a sensible way to do it? Or can anyone suggest a better tried
> and tested way.

Are you trying to determine how much an employee has worked in a certain
period of time? i.e. Week/month/year?

What triggers the creation and modification of each record? Is the
employee required to clock in and clock out manually or is this all
predetermined?


hth,
Chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to