DELETE query - Could Not Delete From Specified Tables

A

Aaron

I have created a select query that brings back a set of
records that I want to delete from a table, I then created
a delete query that refers to the table I want to delete
from and the select query mentioned above. Unique records
is set to yes but I still cant delete the records. The SQL
is as follows...

DELETE DISTINCTROW TEMP_PUPIL_EXPORT.*,
TEMP_PUPIL_EXPORT.TEMP_DFES_UPN
FROM TEMP_PUPIL_EXPORT, SELECT_PUPILS_TEMP_PUPIL_EXPORT
WHERE (((TEMP_PUPIL_EXPORT.TEMP_DFES_UPN) In
([SELECT_PUPILS_TEMP_PUPIL_EXPORT].[TEMP_DFES_UPN])));

Anyone have any ideas as to why this isnt working?
 
M

Michel Walsh

Hi,

Try:


DELETE temp_pupil_export.*
FROM temp_pupil_export
WHERE temp_dfes_upn IN
( SELECT temp_dfes_upn
FROM select_ouoils_temp_pupil_export);




Hoping it may help,
Vanderghast, Access MVP
 

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

Top