Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Attendance System

Author  Topic 

caisys
Starting Member

16 Posts

Posted - 2007-12-13 : 15:13:47
Hi everyone,
I am working on a web based tool to handle attendance and leaves.
Our working hours start at 9:00 but managers will be allowed to set different starting hours for some of their staff.
I will eventually need to view the employee attendance record over a period of say a month.

My question is about storing the modified working hours
I can either:
1) record the (employee name, starting date of modified time, end date of modified time, new start time) as one record and use the f_table_date function

OR

2) Generate the days between the start and end in the application front end and store values for each day in the modified working table.

I feel option 2 will be easier to calculate the reports and prevent managers from inserting modifed times for the same employees in overlapping periods but also think it's a bit not effecient to generate day values when the start and end date would be represent the same information.

Any guidance or am I not clear?
Thanks

JasonL
Starting Member

35 Posts

Posted - 2007-12-16 : 00:36:23
From Database design standpoint, I would have done it this way:

Table: Default_start(Employee, Start_time)
example records:
Smith,9am
John, 1pm
...
Table: Employee_XXXx (Employee, Effective_Date, Start_time)
examples ecords looks something like this
John, 15-Nov-2007, 1pm
John, 25-Dec-2007, 9am
John, 02-Jan-2008, 1pm
Smith, 01-jan-2008, 9am,
Smith, 01-feb-2008, 10am
Smith, 15-feb-2008, 9am
This means for Smith starting from 01-feb-2008 start time is 10am effective until 14-feb-2008

JasonL
Go to Top of Page
   

- Advertisement -