I have two tables:
TblNewList contains
EmpName
TrainingClass
EmpID
and other fields
TblNCList contains
EmpID
TrainingClass
EmpName
and other fields
So if the ID and the class don't already exist in the receiving table, I want to add the record.
I want to run a query that appends records from the tblNewList to the tblNCList where the combination of EmpID and TrainingClass are not already in the tblNCList. If it was only one field, I created a simple find unmatched query on ID, then added the TrainingClass field. But when I add the second field to the SQL statement, it doubles the number of output records by duplicating each one. Probably an easy fix, but I thought I'd ask. Here's the current SQL code:
Code: Select all
INSERT INTO tblNCList ( UserName, TrainingClass, EmpID, MemCont )
SELECT tblNewList.EmpName, tblNewList.TrainingClass, tblNewList.EmpID, tblNewList.MemCont
FROM tblNewList LEFT JOIN tblNCList ON (tblNewList.[TrainingClass] = tblNCList.[TrainingClass]) AND (tblNewList.[EmpID] = tblNCList.[EmpID])
WHERE (((tblNCList.EmpID) Is Null));
Thanks!