Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Delete query

Status
Not open for further replies.

JoanieB

Programmer
Apr 17, 2001
57
0
0
US
I have tried using both a select query (not a grouped or action query) as well as a table to show which records I want deleted from another table. In the original selectquery, I individually selected each field (not*). Whenever I try to run the delete query it tells me I have to select which table I want to delete the records from...the design view will not let me. If I add a field to the list and try to change it from "where" to "From", it will not let me. Can anybody help with this?
 
Try this one.

Table1 has multiple fields you wish to delete, and a field called ID.
Table2 has match field (let's call it ID2) as your selection criteria.

You want to delete all information from Table1 where Table1.ID = Table2.ID2

DELETE FROM Table1 WHERE ID in (SELECT ID2 FROM Table2);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top