Adding entried to a table

  • Thread starter Thread starter Shane Morrison
  • Start date Start date
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.
 
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".
 
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
 
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
'====================================================
 
Back
Top