Delete Query Does Not
- From: "Ron Le Blanc" <rleblanc@xxxxxxxxxxxxx>
- Date: Sat, 4 Feb 2006 23:15:16 -0500
I have a database that won't let me delete records using a Delete Query.
I have an Access 2003 database that has several tables in it that are all
related to a client table and have referential integraty and the cascade
delete enabled.
I wish to delete all clients that have not been seen for two years or more.
And yes, I really want to delete them.
A "meal" table contains the last visit date. See relationships...
The idea is to find all clients who have not been seen in two or more years
and delete them.
The data *** view shows that the correct clients are selected. However,
when I try to run the delete query it says it cannot delete the records. The
"client" table is the table to which all other tables are related to.
I don't care if I loose all the data for a client. If the client has not
been in in two years a new record would have to be created anyway.
The SQL generated is:
DELETE client.*, client.MasterID, meals.LastVisit, client.f_name,
client.l_name
FROM client INNER JOIN meals ON client.MasterID = meals.MasterID
WHERE (((meals.LastVisit)<Date()-730));
The error message says: "Cannot delete from table".
Does anyone have an idea as to why this does not work and what might be done
to make it work??
Thanks!
.
- Follow-Ups:
- Re: Delete Query Does Not
- From: John Vinson
- Re: Delete Query Does Not
- Prev by Date: Re: Delete Query Doesnt
- Next by Date: Re: Delete Query Does Not
- Previous by thread: Re: Delete Query Doesnt
- Next by thread: Re: Delete Query Does Not
- Index(es):
Loading