Append Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I don't have any experience with append queries but when I try to run it, I
get an error message stating- "Duplicate output destination 'Employee'. Can
you tell me what's that about?

INSERT INTO Normalization ( Employee, [Date], Rate )
SELECT ActiveEmpPR.[Active Employees].Employee, ActiveEmpPR.Pay_Rate_Date1_,
ActiveEmpPR.Pay_Rate_1, *
FROM Normalization, ActiveEmpPR;

Thanks so much!
 
you trying to insert a duplicate record in the table, which meen that you
have a key in the employee table, and some of the outputs in the query has
the same record.

try and write it like that
the distinct will eliminate duplicates

INSERT INTO Normalization ( Employee, [Date], Rate )
SELECT Distinct ActiveEmpPR.[Active Employees].Employee,
ActiveEmpPR.Pay_Rate_Date1_,
ActiveEmpPR.Pay_Rate_1, *
FROM Normalization, ActiveEmpPR;
 
I don't have any experience with append queries but when I try to run it, I
get an error message stating- "Duplicate output destination 'Employee'. Can
you tell me what's that about?

INSERT INTO Normalization ( Employee, [Date], Rate )
SELECT ActiveEmpPR.[Active Employees].Employee, ActiveEmpPR.Pay_Rate_Date1_,
ActiveEmpPR.Pay_Rate_1, *
FROM Normalization, ActiveEmpPR;

Thanks so much!

Remove the

, *

from the third line (it's including all the other fields in both
ActiveEmpPR and in Normalization, including the Employee field); and
remove Normalization from the FROM clause. You don't need to
(SHOULDN'T!) include the target table in your Append query - as
written this will attempt to insert a new record into Normalization
for every possible combination of records in ActiveEmpPR and
Normalization!

Try

INSERT INTO Normalization ( Employee, [Date], Rate )
SELECT ActiveEmpPR.[Active Employees].Employee,
ActiveEmpPR.Pay_Rate_Date1_,
ActiveEmpPR.Pay_Rate_1
FROM ActiveEmpPR;


John W. Vinson[MVP]
 
Back
Top