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!

Delete Query

Status
Not open for further replies.

primagic

IS-IT--Management
Jul 24, 2008
476
GB

I have the following select query which returns the correct results.

However, I now want to be able to delete these results from the School table. Basically it shows a list of all schools that have no engagements.

Code:
SELECT Engagement.EngagementID, School.SchoolID, School.SchoolName
FROM School LEFT JOIN Engagement ON School.SchoolID = Engagement.SchoolID
WHERE (((Engagement.EngagementID) Is Null))

I have tried the following sql for a delete statement but it says "specify the table containing the records you want to delete"

Code:
DELETE Engagement.EngagementID, Engagement.SchoolID, School.SchoolName
FROM School LEFT JOIN Engagement ON School.SchoolID = Engagement.SchoolID
WHERE (((Engagement.EngagementID) Is Null));

Help please
 
DELETE School.*
FROM School LEFT JOIN Engagement ON School.SchoolID = Engagement.SchoolID
WHERE (((Engagement.EngagementID) Is Null));

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

Part and Inventory Search

Sponsor

Back
Top