Can anyone tell me if there is any simple way in Access SQL of deleting all records in tblA that are specified by having a matching record in tblB?
In other words, I want something like
- except that that doesn't comply with the syntax for a DELETE statement.
I tried the obvious method - creating a SELECT query by putting the two tables on the design canvas, linking them by the shared field name and putting tblA.* as the only column in the design grid (this then displays the wanted records) and then converting it to a DELETE query - but the SQL that Access generates also doesn't comply with the syntax and doesn't work.
It sounds like a simple enough task - but I can't figure it out. Surely it must be possible?
In other words, I want something like
Code:
DELETE tblA.* FROM tblA WHERE tblA.[fieldname] = tblB.[fieldname]
I tried the obvious method - creating a SELECT query by putting the two tables on the design canvas, linking them by the shared field name and putting tblA.* as the only column in the design grid (this then displays the wanted records) and then converting it to a DELETE query - but the SQL that Access generates also doesn't comply with the syntax and doesn't work.
It sounds like a simple enough task - but I can't figure it out. Surely it must be possible?
Comment