DELETE query - Could Not Delete From Specified Tables

  • Thread starter Thread starter Aaron
  • Start date Start date
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?
 
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
 
Back
Top