Delete specific records from a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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...
 
Queenie said:
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...

Records are not in reports, reports just list records. You want to look
in and match records from tables, I would think.
 
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,
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top