Hello All,
I’m having trouble with an Append query. Specifically in the WHERE clause.
Every week I need to append records to Table01 from Table02. Table02 is a linked table from another DB that contains records of employee donations. Table01 tracks the donations in my Access DB.
To eliminate duplications (the source table can have duplicate records) I have the update query below which makes sure the new record being appended has a donation date greater than the previous maximum date of the employee’s record.
Code:
INSERT INTO Table01 ( EmpID, DonateAmount, DonateDate )
SELECT qry_ MatchingRecs.EmpID, qry_UpDate_MatchingRecs. Amount, qry_MatchingRecs.CheckDate
FROM qry_MatchingRecs
WHERE qry_MatchingRecs.CheckDate >DMax("DonateDate"," Table01 ",[EmpID]);
This works fine. However, It will not append new records - since the WHERE clause is searching for a date.
I’ve tried using things like: WHERE IsNull(EmpID) and CheckDate >DMax("DonateDate ) etc. But nothing works.
Any/All suggestions would be GREATLY appreciated!
- lm