Adding entried to a table

S

Shane Morrison

I have three tables, one that list employees (153 entries), one that lists
training needed (26 entries), and one that shows when employees completed
training (3978 entries). I created the employees completed training table by
combining the first two tables as each employee is required to take all
training. If I add a new training need to the training needs table, how can I
add that to the employees completed training table wihtout having to reenter
all the dates that the original 26 training needs were done on. I have tried
an append query and it just adds 3978+153 more entrees instead of just the
one new training need per employee.
 
D

Dorian

Ideally, those records would be added when the employee completes the
training and not ahead of time.
Otherwise, post the SQL of your append query so we can see what you are doing.

-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
J

John Spencer (MVP)

Something like the following might work

INSERT INTO TRAININGCompleted (TrainingID, EmployeeID)
SELECT TrainingNeeded.TrainingID, Employees.EmployeeID
FROM Employees, TrainingNeeded
WHERE TrainingNeeded.TrainingID = 26


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
J

John Spencer

Or even simpler

INSERT INTO TRAININGCompleted (TrainingID, EmployeeID)
SELECT 26 as TrainingID, Employees.EmployeeID
FROM Employees

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 

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