Tuesday, July 24, 2012

ACESS NOT IN Query Issue

Not in statement in access returns no results even I know well that there is some records not in the sub query table.

After searching this issue the only reason I found, if there is null values in the sub query selected list
Then the (not in sub query) statement not working in the way it should
To make not in statement work correctly in MS-Access you should remove the null values then it will return correct results

SELECT *
FROM TABLE1
WHERE TABLE1.C1 NOT IN
(SELECT TABLE2.C2 FROM TBALE2);

No comments:

Post a Comment