I am trying to write a SubQuery to find the records that are not in a range. It is bringing me the records that match, not the rest. Seems like the NOT function isn't working.
Can somebody tell me what I am doing wrong?Code:SELECT YSOC_AvaiL1.BasicMaterial, YSOC_AvaiL1.QtyKCS, YSOC_AvaiL1.Material, YSOC_AvaiL1.ProdOrigin, YSOC_AvaiL1.MG, Left([ProdOrigin],2) AS Country, Right([ProdOrigin],2) AS Region FROM YSOC_AvaiL1 WHERE (((Left([ProdOrigin],2)) Not In (SELECT [YEXCLUSION]![Grower Country] FROM yexclusion WHERE [YEXCLUSION]![Material Group] = [YSOC_AvaiL1]![MG] ;))) ORDER BY YSOC_AvaiL1.BasicMaterial, Left([ProdOrigin],2);


Went back and looked again; since it returned so few records, I thought it was wrong. Doing exactly what it should do.
.

