Been given a rush query to do in an access database, am quite rusty.
Here is what I need:
TABLE1
EMPLID, YEAR
TABLE2
EMPLID
TABLE3
EMPLID
OK, here is the logic as best as I can describe it:
I need to:
DELETE FROM TABLE1 WHERE TABLE1.EMPLID DOES NOT EQUAL TABLE2.EMPLID AND
YEAR < 2006
OR WHERE TABLE1.EMPLID = TABLE3.EMPLID
Am not sure about how to join the tables, if you could convert that
into useable SQL it would be appreciated....
Thanks
MGFoster - 21 Mar 2006 23:25 GMT
Perhaps:
DELETE *
FROM table1 as t1
WHERE [year] < 2006
AND NOT EXISTS (SELECT * FROM table2 WHERE emplid = t1.emplid)
AND EXISTS (SELECT * FROM table3 WHERE emplid = t1.emplid)

Signature
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
> Been given a rush query to do in an access database, am quite rusty.
> Here is what I need:
[quoted text clipped - 20 lines]
>
> Thanks