Delete Query with Requirements

S

soberman

Hi all. I am trying to build a delete query that will delete a
household (single record) in a table IF AND ONLY IF the balance for
that household is zero. The balance information is located in a
calculated field in a query. How do I instruct the delete query to
verify a zero balance in the balance query before deleting the record
in the household table?
 
J

John Spencer

Generically, that would look something like the following.

DELETE SomeTable.HouseHoldIDField
FROM SomeTable
WHERE HouseHoldIDField = "Something" AND
HouseHouldIdField in (SELECT HouseholdIDField From YourSummaryQuery
WHERE SumOfCharge = 0)
 

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

Top