View Single Post
  #6  
Old February 6th, 2006, 04:21 AM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Delete Query Does Not

This does not work. It selects many clients who have been in within two
years.
It does find a bunch of the "right" clients to delete but also includes what
seems be be random other clients not meeting the two years since last time
they came in.




"John Vinson" wrote in message
...
On Sat, 4 Feb 2006 23:15:16 -0500, "Ron Le Blanc"
wrote:

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".


You're trying too hard. Don't delete anything from the Meals table -
cascading deletes will take care of that.

DELETE client.*
FROM client INNER JOIN meals ON client.MasterID = meals.MasterID
WHERE (((meals.LastVisit)Date()-730));


John W. Vinson[MVP]