barbarafloyd
Programmer
Hi,
Im Using Access 2003 and I am pretty new to SQL and am struggling to understand why my query wont work. I have 2 tables and I want to return only those rows from the first table where the joint primary key is not in the second.
My code is below, and it returns 0 rows even though I know there are 2 rows in XP Product List table that have a different "set" of 3 fields that make up the primary key.
*boggle*
thanks very much for your help!
SELECT *
FROM [XP Product list]
WHERE NOT EXISTS
(SELECT 1
FROM ([XP Product list] INNER JOIN [MAIN CBA VALIDATION]
ON [XP Product list].Application = [MAIN CBA VALIDATION].Application
AND [XP Product list].Type = [MAIN CBA VALIDATION].Type
AND [XP Product list].[Packaging Status] = [MAIN CBA VALIDATION].[Packaging Status])
WHERE [XP Product list].Type = "SWAB"
AND [XP Product list].[Packaging Status] Like "Comp*" )
Im Using Access 2003 and I am pretty new to SQL and am struggling to understand why my query wont work. I have 2 tables and I want to return only those rows from the first table where the joint primary key is not in the second.
My code is below, and it returns 0 rows even though I know there are 2 rows in XP Product List table that have a different "set" of 3 fields that make up the primary key.
*boggle*
thanks very much for your help!
SELECT *
FROM [XP Product list]
WHERE NOT EXISTS
(SELECT 1
FROM ([XP Product list] INNER JOIN [MAIN CBA VALIDATION]
ON [XP Product list].Application = [MAIN CBA VALIDATION].Application
AND [XP Product list].Type = [MAIN CBA VALIDATION].Type
AND [XP Product list].[Packaging Status] = [MAIN CBA VALIDATION].[Packaging Status])
WHERE [XP Product list].Type = "SWAB"
AND [XP Product list].[Packaging Status] Like "Comp*" )