How do I delete one entire table from another table in Access?

  • Thread starter Thread starter Guest
  • Start date Start date
Do you mean how do you delete all of the records that match another table in
some criteria?

As you are new to this, Backup the database.
You add the tables to the Query Window (QBE grid)
Join on common fields.
click delete query
enter the fields and criteria that identify the records you want deleted .
Check the operation by clicking on the grid icon, which shows the affected
records without deleting anything.
If all looks OK click the ! mark to run the delete query.
 
I ran unmatched query from one tabl to another. Now I want to delete the
entire record of table 1 from table 2. I have tried it several different
ways, but I keep receiveing an error that I can not delete from specified
table.
 
It sound to me that you want to delete records in Table1 that don't have
"matching" Records in Table2 and you want to convert the (Select) Unmatch
Query to a Delete Query? This is more of a guess rather than my definite
understanding of the description.

Suggest you post the relevant Table details, e.g. Fields you tries to match
/ unmatch and what you want to do, the SQL String of the Unmatch Query, the
SQL String of your attempted Delete Query.

Also a small sample set of data and which Records from the sample set would
help ...
 
If you have a record in table1 that has no match in table2 then
You cannot want to delete the record in table2, because there is not one
there.
So you must be trying to delete the record in table1
which i would do with something like:-

DELETE Table1.ID
FROM Table1
WHERE Table1.ID) IN
(SELECT Table1.ID FROM Table1 LEFT JOIN table2 ON Table1.[ID] =
table2.[id_table1]
WHERE table2.id_table1 Is Null);
 

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

Back
Top