Sorry guys, I wasn't feeling well for a couple of days. I'm back in the
saddle now.
From Ellison and Vinson:
DELETE * FROM Client
WHERE MasterID NOT IN
(SELECT DISTINCT MasterID FROM Meals
WHERE Meals.LastVisit > DateAdd("yyyy", -2, Date()))
AND MasterID IN
(SELECT DISTINCT MasterID FROM Meals
WHERE Meals.LastVisit <= DateAdd("yyyy", -2, Date()));
Results after running:
DELETE Client.MasterID, *
FROM Client
WHERE (((Client.MasterID) Not In (SELECT DISTINCT MasterID FROM Meals
WHERE Meals.LastVisit > DateAdd("yyyy", -2, Date())) And (Client.MasterID)
In (SELECT DISTINCT MasterID FROM Meals
WHERE Meals.LastVisit <= DateAdd("yyyy", -2, Date()))));
As you can see it morphed the SQL statement again. It ran for a couple of
minutes but as far as I can tell nothing was deleted. I have the same number
of records I started with.
I entered the same SQL statement (the first one) and changed it to a Select
query. It ran for about the same amount of time and then showed me a single
empty row in datasheet view. No cigar!!!
I am going back to an ABACUS now, assuming I don't have to enter the
question in SQL.
<Sigh>
Does anyone have a shotgun I can borrow for a few minutes?
Any other ideas?
Thanks for all your efforts, I really appreciate it. I don't feel out in the
woods all alone. You guys are with me, yes?
Take care,