Maintaining Log details.

A

Anand Vaidya

I am working on timesheet application.I am entering attendance details of all
employees in the table tblDaily_Attendance.I open a new record when an
employee is checking In for the day.I open this existing record for
modification( filling the appropriate fields ) if he wants to take a
Lunch/General break and also if he is checking out for the day.
But my senior wants to have log details of the activities that took place on
a perticular date in a sequential order as occured. say for eg -
[date] [emp] [activity]
4/24/2006 emp1 checked in for the day
4/24/2006 emp3 checked in for the day
4/24/2006 emp1 went out for a lunch break
4/24/2006 emp2 checked in for the day
4/24/2006 emp3 went out for a general break
4/24/2006 emp1 came back from the lunch break
4/24/2006 emp2 went out for a general break
4/24/2006 emp1 went out for a general break
4/24/2006 emp3 came back from the general break
........................................................ and so on
Do I have to take a seperaate table for this and store all the activities in
it parallel to storing the emp. activities in the tblDaily_Attendance?
 
K

Klatuu

To get the entries in chronological order, all you need to do is store the
full date and time using Now() when any event occors.
Then if you sort your output by employee and the date/time field or by just
the date/time field, it will be in the correct order.

As to the second table, it is of no value for ordering the output, but it is
a good idea for good database normalization. Each possible event should be
in a table and have an Autonumber as the primary key. Then, rather than
store the full test in the table where the time is kept, store just the key
to the events table.
 
A

Anand Vaidya

Klatuu,The problem is , I am not creating each activity as a new record.
Rather I am creating a record only while checking-In for the day.For the rest
of activities , I am opening the existing record and filling the values.So I
can't have the sequential order of activities.
So do I have to take another table for this purpose?
say tblLogDetails with fields [DtandTime] [emp_id] and [activity_id]
parallelly adding the data to both tblDaily_Attendance and tblLogDetails when
an activity occurs.


-------------
Anand Vaidya
I'm here to know.


Klatuu said:
To get the entries in chronological order, all you need to do is store the
full date and time using Now() when any event occors.
Then if you sort your output by employee and the date/time field or by just
the date/time field, it will be in the correct order.

As to the second table, it is of no value for ordering the output, but it is
a good idea for good database normalization. Each possible event should be
in a table and have an Autonumber as the primary key. Then, rather than
store the full test in the table where the time is kept, store just the key
to the events table.

Anand Vaidya said:
I am working on timesheet application.I am entering attendance details of all
employees in the table tblDaily_Attendance.I open a new record when an
employee is checking In for the day.I open this existing record for
modification( filling the appropriate fields ) if he wants to take a
Lunch/General break and also if he is checking out for the day.
But my senior wants to have log details of the activities that took place on
a perticular date in a sequential order as occured. say for eg -
[date] [emp] [activity]
4/24/2006 emp1 checked in for the day
4/24/2006 emp3 checked in for the day
4/24/2006 emp1 went out for a lunch break
4/24/2006 emp2 checked in for the day
4/24/2006 emp3 went out for a general break
4/24/2006 emp1 came back from the lunch break
4/24/2006 emp2 went out for a general break
4/24/2006 emp1 went out for a general break
4/24/2006 emp3 came back from the general break
....................................................... and so on
Do I have to take a seperaate table for this and store all the activities in
it parallel to storing the emp. activities in the tblDaily_Attendance?
 
K

Klatuu

You are half right. What you put in tblLogDetails should not go in the other
table.
In tblLogDetails, you will need a field to join it to the appropriate record
in tblDaily_Attendance.

Anand Vaidya said:
Klatuu,The problem is , I am not creating each activity as a new record.
Rather I am creating a record only while checking-In for the day.For the rest
of activities , I am opening the existing record and filling the values.So I
can't have the sequential order of activities.
So do I have to take another table for this purpose?
say tblLogDetails with fields [DtandTime] [emp_id] and [activity_id]
parallelly adding the data to both tblDaily_Attendance and tblLogDetails when
an activity occurs.


-------------
Anand Vaidya
I'm here to know.


Klatuu said:
To get the entries in chronological order, all you need to do is store the
full date and time using Now() when any event occors.
Then if you sort your output by employee and the date/time field or by just
the date/time field, it will be in the correct order.

As to the second table, it is of no value for ordering the output, but it is
a good idea for good database normalization. Each possible event should be
in a table and have an Autonumber as the primary key. Then, rather than
store the full test in the table where the time is kept, store just the key
to the events table.

Anand Vaidya said:
I am working on timesheet application.I am entering attendance details of all
employees in the table tblDaily_Attendance.I open a new record when an
employee is checking In for the day.I open this existing record for
modification( filling the appropriate fields ) if he wants to take a
Lunch/General break and also if he is checking out for the day.
But my senior wants to have log details of the activities that took place on
a perticular date in a sequential order as occured. say for eg -
[date] [emp] [activity]
4/24/2006 emp1 checked in for the day
4/24/2006 emp3 checked in for the day
4/24/2006 emp1 went out for a lunch break
4/24/2006 emp2 checked in for the day
4/24/2006 emp3 went out for a general break
4/24/2006 emp1 came back from the lunch break
4/24/2006 emp2 went out for a general break
4/24/2006 emp1 went out for a general break
4/24/2006 emp3 came back from the general break
....................................................... and so on
Do I have to take a seperaate table for this and store all the activities in
it parallel to storing the emp. activities in the tblDaily_Attendance?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top