Unmatched query wizard??

  • Thread starter Thread starter geeves1293
  • Start date Start date
G

geeves1293

I have succesfully made a Unmatched query using the wiz.

I changed the query to a delete query, but when I run it, it asks me which
table do i want to delete the records from.

I keep screaming at it 'what do you mean which table isn't it obvious', but
that doesn't work.

Can anyone tell me how to overcome this please.

Regards

Geeves1293
 
Use a subquery to select the unmatched records

This example deletes records in tblInvoice that have no matching records in
tblInvoiceDetail:

DELETE FROM tblInvoice
WHERE NOT EXISTS
(SELECT InvoiceID
FROM tblInvoiceDetail
WHERE tblInvoiceDetail.InvoiceID = tblInvoice.InvoiceID);

If subqueries are new, here's an introduction:
http://allenbrowne.com/subquery-01.html#NotThere
 
Back
Top