Delete Data in one table that is in another Table

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

Guest

I have my main table that conatains all the current data.
The other table i created from a query that Data is no longer needed in the
main table. and need to run a delete query to delete whats in main table
that matches whats in the second table.

I'm sorta new to making delete query's so any help would be appreciated.

DELETE *
FROM ClintracWork, DeleteFinnished
WITH OWNERACCESS OPTION;


Ive tried joining but im sure i was making mistakes. ClintracWork is the
main table with all the data, and DeleteFinnished is the table that holds
the data that needs to be deleted from ClintracWork.

I tried doing a a form with which worked off a unmatched querry for
ClintrWork vs DistinctAccounts so i could update the delte field with a yes
command but states its not updatable. whihc the datasheet that comes up
with querry isnt but main table is. so thats why im going this route with
making a table of data to delete from the main table.

sorry for long drawn out post but anyhelp would be greatly appreciated.
 
First BACK UP your data.

Try something like

Delete * From MainTable Where
JoinField In (Select JoinField From SecondTable)


The JoinField is the field that join both tables
 
Thank-you this solved my problem.

Ofer Cohen said:
First BACK UP your data.

Try something like

Delete * From MainTable Where
JoinField In (Select JoinField From SecondTable)


The JoinField is the field that join both tables
 

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