S
skk
Hi! Please help & thank you in advance.
I have 2 tables (tblT, tblL) with no unique key so, I’ve created autonumber
on both tables.
Query the tblX for below criteria selects 26 records:
SELECT tblX.prodName, tblX.prodID, tblL.prodName, tblL.prodID, tblL.TEST_DATE
FROM tblX
WHERE (((tblX.prodName)="PROD1") AND ((tblX.prodID)="123"))
My objective is to select the “tblL.TEST_DATE†from tblL when prodName &
prodID is equal from both tables but when I use the below SQL it doubles the
records count to 56 records. I think record count should still be 26 but
just show the TEST_DATE from the tblL. Do you see anything wrong with above
SQL statement?
SELECT tblX.prodName, tblX.prodID, tblL.prodName, tblL.prodID, tblL.TEST_DATE
FROM tblX LEFT JOIN tblL ON (tblX.prodName=tblL.prodName) AND
(tblX.prodID=tblL.prodID)
WHERE
(((tblX.prodName)="PROD1") AND (tblX.prodID)="123")) AND
((tblL.prodName)="PROD1") AND (tblL.prodID)="123")));
I have 2 tables (tblT, tblL) with no unique key so, I’ve created autonumber
on both tables.
Query the tblX for below criteria selects 26 records:
SELECT tblX.prodName, tblX.prodID, tblL.prodName, tblL.prodID, tblL.TEST_DATE
FROM tblX
WHERE (((tblX.prodName)="PROD1") AND ((tblX.prodID)="123"))
My objective is to select the “tblL.TEST_DATE†from tblL when prodName &
prodID is equal from both tables but when I use the below SQL it doubles the
records count to 56 records. I think record count should still be 26 but
just show the TEST_DATE from the tblL. Do you see anything wrong with above
SQL statement?
SELECT tblX.prodName, tblX.prodID, tblL.prodName, tblL.prodID, tblL.TEST_DATE
FROM tblX LEFT JOIN tblL ON (tblX.prodName=tblL.prodName) AND
(tblX.prodID=tblL.prodID)
WHERE
(((tblX.prodName)="PROD1") AND (tblX.prodID)="123")) AND
((tblL.prodName)="PROD1") AND (tblL.prodID)="123")));