Delete Query

Mojo1

Board Regular
Joined
Mar 6, 2003
Messages
148
DELETE *
FROM dbo_idfy
WHERE PEOPLE_CODE_ID NOT IN (SELECT
dbo_ACADEMIC.PEOPLE_CODE_ID
FROM dbo_ACADEMIC INNER JOIN dbo_idfy ON dbo_ACADEMIC.PEOPLE_CODE_ID =
dbo_idfy.people_code_id
WHERE (((dbo_ACADEMIC.ACADEMIC_YEAR)=[Enter Academic Year]) AND
((dbo_ACADEMIC.ACADEMIC_TERM)=[Enter Academic Term]) AND
((dbo_ACADEMIC.ACADEMIC_SESSION)="01") AND ((dbo_ACADEMIC.ACADEMIC_RATING)
="Here")));

What can I do to make this work? When I try to run ithe query it just sits there.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Try turning it into a SELECT query. When you run it do you get any records?
If not, take a look at the query grid and check the links. Sometimes, instead of (say) 3 tables llinked in a chain, you end up with an extra link (because of Autojoin) that closes the loop. You won't get records that way.
Whatever, play with the query until you see the records that you want to delete. Then change it back to a DELETE query.

HTH
Denis
 
Upvote 0

Forum statistics

Threads
1,221,575
Messages
6,160,603
Members
451,657
Latest member
Ang24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top