Delete Query Error

B

BBAL20

I'm trying to execute the delete query below, but Access keeps giving me an
error that it "Could not delete from specified tables". It looks as though it
might have something to do with the write access, but I know I've opened up
the database for both read/write access. I've created/imported all tables
myself. I'm not connected via ODBC at all. Does anyone have any suggestions?


DELETE Daily_Scrubbed.*
FROM Daily_Scrubbed INNER JOIN Daily_Scrubbed_Dupes ON
Daily_Scrubbed.CHD_ACCOUNT_NUMBER = Daily_Scrubbed_Dupes.CHD_ACCOUNT_NUMBER;
 
J

John Spencer

Try
DELETE DISTINCTROW Daily_Scrubbed.*
FROM Daily_Scrubbed INNER JOIN Daily_Scrubbed_Dupes ON
Daily_Scrubbed.CHD_ACCOUNT_NUMBER = Daily_Scrubbed_Dupes.CHD_ACCOUNT_NUMBER;

IF that won't work then use a subquery in the where clause

DELETE DISTINCTROW Daily_Scrubbed.*
FROM Daily_Scrubbed
WHERE Daily_Scrubbed.CHD_ACCOUNT_NUMBER IN (
SELECT CHD_ACCOUNT_NUMBER
FROM Daily_Scrubbed_Dupes)


--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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