JimSmith
11-08-2009, 09:42 AM
Hi,
I can't get my head around this very basic relationship between tables, and was hoping for some guidance.
I want to store the number of hours worked by each named person on each date. Many individuals can work on the same date. However I want to set up the relationships in the access database to ensure it is impossible to record more than number of hours worked per date per person.
My logic so far-
I need an employee table :
Unique employee id (primary key)
First name
Second Name
etc...
I need a hours worked table
Unique ID (primary key)
Date
Hours worked
Unique employee id
Then I would have a one to many relationship between the two tables linked on unique employee id.
But this is where I get stuck, as it doesn’t stop me entering hours worked for the same date twice for one employee.
I toyed with the idea of a 3rd table containing dates, but then I don’t know how to link these 3 tables.
Please can some one give me some guidance?
Many Thanks in advance
Jim
I can't get my head around this very basic relationship between tables, and was hoping for some guidance.
I want to store the number of hours worked by each named person on each date. Many individuals can work on the same date. However I want to set up the relationships in the access database to ensure it is impossible to record more than number of hours worked per date per person.
My logic so far-
I need an employee table :
Unique employee id (primary key)
First name
Second Name
etc...
I need a hours worked table
Unique ID (primary key)
Date
Hours worked
Unique employee id
Then I would have a one to many relationship between the two tables linked on unique employee id.
But this is where I get stuck, as it doesn’t stop me entering hours worked for the same date twice for one employee.
I toyed with the idea of a 3rd table containing dates, but then I don’t know how to link these 3 tables.
Please can some one give me some guidance?
Many Thanks in advance
Jim