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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete Query: Delete record in Table1 using data in Table2 1

Status
Not open for further replies.

wwwjont

Vendor
May 14, 2010
2
GB
Hi,

I am trying to delete records in one table using data in another table. Table1 would have forename surname dob and table2 has just dobs. Where dobs match in Table1 and Table2 I want to delete the record in table1. I have tried various querys without success. (I am working in Access) Any help would be gratefully appreciated.

Thanks
John
 
One way:
DELETE FROM Table1
WHERE dob IN (SELECT dobs FROM table2)

Another way:
DELETE Table1.*
FROM Table1 INNER table2 ON Table1.dob = table2.dobs

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
One way:
DELETE FROM Table1
WHERE dob IN (SELECT dobs FROM table2)

Another way:
DELETE Table1.*
FROM Table1 INNER JOIN table2 ON Table1.dob = table2.dobs

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top