Delete specific records from a query

Q

Queenie

I'm using two reports which have mostly the same records, but some records
contained in one are not in the other. I'm trying to establish a
relationship between these reports. Report A has records that are not found
in Report B and vice versa. I've run a UnmatchQuery on Report A to identify
the records that exist in Report A, but not in Report B. Once I've identified
these, I'd like to delete the results of the Unmatch Query (essentially,
those items which are found in Report A but not in Report B) from Report A so
that the two reports/files contain the same records.

Can anyone help me with this?

Many thanks...
 
Q

Queenie

I should have included "tables" instead of reports. I ran an unmatched query
wizard and I would like to delete those records (results from Unmartched
query) from table A, hope this makes more sense,
 
V

Van T. Dinh

If you have a Field that uniquely identifies Records in both TableA and
TableB, try something like:

DELETE TableA.*
FROM TableA LEFT JOIN TableB
ON TableA.RecordID = TableB.RecordID
WHERE TableB.RecordID Is Null
 
Top