How do I delete records based on matching records in a subquery? MS Access
Posted on 2008-10-18
I want to delete any records from a table (tblAllData) before I append new records from qryNewData. I don't know how to do this. Subqueries are a mystery.
Here is my SQL
(SELECT qryNewData.SchoolNum, qryNewData.ReportType, qryNewData.ShortVarCode, qryNewData.Year
WHERE tblAllData.SchoolNum = qryNewData.SchoolNum AND tblAllData.ReportType =qryNewData.ReportType AND tblAllData.ShortVarCode = qryNewData.ShortVarCode AND tblAllData.Year = qryNewData.Year);
Unfortunately, this returns ALL records from tblAllData, If I execute it I would be deleting everything, which is not my intent.
How in the devil do I accomplish this?