DELETE query

R

Rudy W.

I'm using Access 2002.
I'm trying to execute following delete query:

DELETE Table1.* FROM Table2 INNER JOIN Table1 ON
Table2.ID = Table1.ID WHERE Table2.ContributionYear=2003;

I always get following error message:

Could not delete from specified tables.
Table1 is a table containing only the field ID.
For this table a relationship has NOT been defined.
Table2 is a table containing two fields ID and
ContributionYear. For this table neither a relationship
has been defined.
In the previeuw of the records to be deleted I see about
the records to be deleted and they are the ones to be
deleted.
On execution I get the error message.
What is wrong here?

I tried with the same result:

DELETE Table1.* FROM Table1 INNER JOIN Table2 ON
Table1.ID = Table2.ID WHERE Table2.ContributionYear=2003;

and even

DELETE Table1.* FROM Table1 INNER JOIN Table2 ON
Table1.ID = Table2.ID;

Thanks

R.W.
 
M

Michel Walsh

Hi,


Add DISTINCTROW, as in

DELETE DISTINCTROW Table1.* FROM ...


Hoping it may help,
Vanderghast, Access MVP
 
R

Rudy W.

That did it!

thanks a lot

R.W.
-----Original Message-----
Hi,


Add DISTINCTROW, as in

DELETE DISTINCTROW Table1.* FROM ...


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