Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time entry, please help!!!

Status
Not open for further replies.

lbonsemb

Technical User
Dec 1, 2001
4
US
I am a newy so please bear with me.
I am building a database to capture how many hours each employee works. Each day, the user will have to input the start time (ST) and the finish time (FT) and the program would calculate how many hours each person worked. My questions is:
What type of table do I have to build that would store ST and FT for each person for each day? (I guess the table would have to be set up to allow data in for each day-. Is this the smart way of doing it or can you recommend a better way?
Thanks a lot,
Luis
 
if you only intend on having 1 st & ft for each day then you would just need the one table with the person & the date as the primary key
 
Thanks for your response.
I would have one ST and FT for each day but they'll vary for each person.
Also, where do I store the info. as days go by? If I build a table with the info. you told me I'll be overwriting it every day.
I know this is very basic but I need to know it.
Thanks again
 
With this simple setup you should be able to enter all you want, it won't overwrite existing data if you only enter to new records, and your query will be able to calculate all time and salary, even if they have 2 start and stop times in a day:

tblEmployees
EmployeeID (Primary Key)
EmployeeLastName
EmployeeFirstName
EmployeeWages (Currency)

tblTime
EmployeeID (Set Look Up property to Combo Box and select the query "qryEmployees")
Date (with a Default value of "Date()")
Start Time
Stop Time

qryEmployees
EmployeeID
EmployeeLastName (Deselct the Show box)
EmployeeFirstName (Deselect the show box)
Create a new field with the name information by typing in the field box 'Employee: [EmployeeLastName]", "[EmployeeFirstName]'. This will give you a field that looks like "Smith, John".

Then set the relationship between the EmployeeID of tblEmployees and EmployeeID of tblTime.

Design the queries to perform what you would like. Remeber to only store the start and stop times in the tables, the hours worked and pay calculations should be performed in the queries to save dbase space. Sean.
 
OK. In the first table you have the person, date, st, ft with the primary key the person & date. You would add a new record for each day & person and you can calculate the time spent in a report or if you want to look at it directly in the table, you add a time spent field in table and calculate it when the times are entered in.
Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top