Delete Query - Create a list of words to delete

tension22

New member
Local time
Today, 00:04
Joined
May 22, 2010
Messages
3
Hi,

Would anyone know to create a delete query that looks up the criteria to delete from another table of products.

So the result would be, to delete all records were items in PRODUCT collum matches products in the other table, so on completion every record the contains a product in the other table of products will be deleted.

Thanks!
 
Create a Select type query that produces the values from the column in the table has has the Product values you what to have deleted from the other table.

Once you have this select type query producing the correct list if values, switch to SQL view and copy the sql statement to the clipboard.
Next, create a Delete type query based on the table you want the records deleted from. Be sure that the Product field is in that query. In the criteria of the Product field, Type: IN( and then paste in the sql statement you copied from the first query and place a closing parenthese at the end.

You should have something that looks like:

IN(Select ...)

With your complete sql statment in the parenthese.

When you run this query it will delete all records where the Product is in the select statement.
 

Users who are viewing this thread

Back
Top Bottom