jt463
IS-IT--Management
- Nov 23, 2005
- 134
I am having trouble pulling back the records I want.
I have two tables:
NewLotInformation (NLI) [primary key - subdivision]
WarrantyLetter (WL) [primary key - subdivision]
I want to pull back all records from NLI EXCEPT all the records that exist on WL. There are three records on WL that I want those subdivision records to be excluded from the query results.
The following is my SQL in Access:
SELECT DISTINCT NewLotInformation.Subdivision, NewLotInformation.DateClosed, NewLotInformation.Complete
FROM NewLotInformation
WHERE NOT EXISTS (SELECT *
FROM NewLotInformation, WarrantyLetter
WHERE [NewLotInformation].[Subdivision]=[WarrantyLetter].[Subdivision]);
I have tried some variants of the syntax, but every time I do, I get no results!
The following JOIN provides the results of the three records I want to EXCLUDE from my query:
SELECT NewLotInformation.Subdivision, NewLotInformation.Complete, NewLotInformation.DateClosed
FROM NewLotInformation INNER JOIN WarrantyLetter ON NewLotInformation.Subdivision = WarrantyLetter.Subdivision;
Thanks in advance!
I have two tables:
NewLotInformation (NLI) [primary key - subdivision]
WarrantyLetter (WL) [primary key - subdivision]
I want to pull back all records from NLI EXCEPT all the records that exist on WL. There are three records on WL that I want those subdivision records to be excluded from the query results.
The following is my SQL in Access:
SELECT DISTINCT NewLotInformation.Subdivision, NewLotInformation.DateClosed, NewLotInformation.Complete
FROM NewLotInformation
WHERE NOT EXISTS (SELECT *
FROM NewLotInformation, WarrantyLetter
WHERE [NewLotInformation].[Subdivision]=[WarrantyLetter].[Subdivision]);
I have tried some variants of the syntax, but every time I do, I get no results!
The following JOIN provides the results of the three records I want to EXCLUDE from my query:
SELECT NewLotInformation.Subdivision, NewLotInformation.Complete, NewLotInformation.DateClosed
FROM NewLotInformation INNER JOIN WarrantyLetter ON NewLotInformation.Subdivision = WarrantyLetter.Subdivision;
Thanks in advance!