Append unique values MS Access Query

1.4k views Asked by At

I have 2 tables, the source called "QA" and the destination table called "Combine". I will like to append only unique records base on the [Call_ID] criteria. I need help with the where clause, the insert query is:

INSERT INTO combine ( source, date_update, [Year], [Month], [Day], quarter, week, QAcount, sup, agent_name, QA_A, date_c, login_name, QA_CALL_ID )
SELECT "QA" AS source, Date() AS CURDATE, Year([date_c]) AS Y, Month([date_c]) AS M, Day([date_c]) AS D, DatePart('q',[date_c]) AS Q, Weekday([date_c],1) AS W, "1" AS [count], Roster.Supervisor, Roster.agent_name, QA.QA_A, QA.date_c, QA.login_name, QA.[Call ID]
FROM QA LEFT JOIN Roster ON QA.login_name = Roster.tCAM;

Insert only where [QA].[Call ID] is different from [combine].[QA_CALL_ID] AND Is not null. Please help me with this sentence.

enter image description here

1

There are 1 answers

0
Gene On
WHERE [QA].[Call ID] <> [combine].[QA_CALL_ID] AND [combine].[QA_CALL_ID] NOT IS NULL

maybe missing any the parenthesis that Access likes to use a ton of..