M
MarkS
I am confused with the following Query. I would like to delete all records
where the ITNO, PO, Line, and Vendor fields are the same in two tables.
DELETE FROM tblReleased WHERE
(
ITNO IN (SELECT ITNO FROM tblEmailedLines)
AND PO IN (SELECT PO FROM tblEmailedLines)
AND LINE IN (SELECT LineNumber FROM tblEmailedLines)
AND VCODE IN (SELECT VendorCode FROM tblEmailedLines)
)
However the code seems to be deleting virtually all records and I cannot
figure out the logic. Can anybody shed some light on this or a better way of
constructing the Query.
Thanks in advance
where the ITNO, PO, Line, and Vendor fields are the same in two tables.
DELETE FROM tblReleased WHERE
(
ITNO IN (SELECT ITNO FROM tblEmailedLines)
AND PO IN (SELECT PO FROM tblEmailedLines)
AND LINE IN (SELECT LineNumber FROM tblEmailedLines)
AND VCODE IN (SELECT VendorCode FROM tblEmailedLines)
)
However the code seems to be deleting virtually all records and I cannot
figure out the logic. Can anybody shed some light on this or a better way of
constructing the Query.
Thanks in advance