Append query using distinct

Design by Sue

Registered User.
Local time
Today, 11:53
Joined
Jul 16, 2010
Messages
816
I have a compound index of Line and QTDate in my table. I am trying to append information provided to me in a excel file. When I try to append I get the message telling me there are key violations. I am not I have my append query set up correctly to select distinct based on the 2 fields. ( Lead and inspector all have a value "unassigned") When I view the results it appears that they are correct and there are no duplications. Could my append query be wrong or what might be causing the key violation? Any help greatly appreciated.



INSERT INTO MainTBL ( Line, QTDate, Lead, Inspector )
SELECT DISTINCT [QTTBL2].Line, [QTTBL2].QTDate, [QTTBL2].Lead, [QTTBL2].Inspector
FROM [QTTBL2];

Sue
 
Finally figured it out - there were relationships between a couple of other tables and the values in the new info were not in the related tables.

Sue
 

Users who are viewing this thread

Back
Top Bottom