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.
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
Not In (SELECT [YEXCLUSION]![Grower Country] FROM yexclusion
WHERE [YEXCLUSION]![Material Group] = [YSOC_AvaiL1]![MG] ;)))
ORDER BY YSOC_AvaiL1.BasicMaterial, Left([ProdOrigin],2);
Can somebody tell me what I am doing wrong?
Subscribe to get a FREE chapter from Windows 7 The Missing Manual
This month, every Windows Secrets subscriber can download a one-chapter excerpt of Windows 7: The Missing Manual.Windows 7: The Missing Manual provides valuable information to help you overcome these difficulties in learning a new operating system. Subscribe today to download your free excerpt.