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

How to delete specific records using a Delete Query?

Status
Not open for further replies.

Spyder757

Technical User
Aug 29, 2002
129
US
I’ve got a main table that contains:
Agent Name
ID
Vacation Days

And I’ve got a table of employees who have been termed that contains:
Agent Name
ID
Term Date

Now I need to be able to automatically go back and delete the dates the termed agents had been requested out of the main table.

How can I delete specific records using the delete query?

Spyder757
 
Update the red code with the proper table names and also any field names that need be:

Delete A.ID
FROM <MainTable> as A
WHERE A.ID IN (Select B.ID FROM <Employees> as B WHERE ((Not (B.[Term Date]) Is Null)));

Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top