Delete Query - could not delete from specified tables


M

Margaret Bartley

I'm getting the error message "Could not delete from specified tables."


Here's the SQL:

DELETE wkReport.* FROM wkReport INNER JOIN QryA ON wkReport.SSN = QryA.SSN
WHERE wkReport.SSN Is Not Null;


QryA is a Totals Query that lists all the SSNs that I need to delete from
the wkReport table.
 
Ad

Advertisements

D

Duane Hookom

You can't include a totals query in any query that you expect to delete,
append, or edit records. You will need to find another solution. This might
be a temporary table to replace the totals query or possibly a subquery or
other.
 
J

John W. Vinson

QryA is a Totals Query that lists all the SSNs that I need to delete from
the wkReport table.

That's the problem. As Duane says, no Totals query - nor any query joining a
Totals query - is ever updateable, even if it logically ought to be. Try a
Subquery instead:

DELETE wkReport.* FROM wkReport
WHERE SSN IN(SELECT SSN FROM qryA);
 
Ad

Advertisements

M

Margaret Bartley

Thank you both. I have done a kludgy work-around. I was just hoping maybe
I was missing something .
 

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