creating a delete query that is accessing 2 tables

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

Guest

I am unable to figure out how to tell the query which table I want to delete
the records from.
 
Could you post the SQL of the query that is not working? And tell us which
table you want the records to be deleted from?

DELETE
FROM TableA
WHERE TableA.SomeField in
(SELECT BField FROM TableB WHERE Fieldz = 22)

Another method that may work

DELETE DistinctRow TableA.*
FROM TableA INNER JOIN TableB
ON TableA.XX = TableB.XX
WHERE TableB.Fieldz = 22



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
My assumption is that you know what to delete so why not reference it
directly in the deletequery statement.

When dragging the fields to the grid just place the criteria in the selected
field.
 
Back
Top