Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Matching Query not working 1

Status
Not open for further replies.

PLK3541

IS-IT--Management
Mar 29, 2005
60
US
I have a simple database with contact information last name, address, phone number. There are three tables and I would like to check to see what info is missing from one table to the next. I have done an unmatched query, table 1 to table 2 and table 1 to table 3. I would like a query to see what information is on table 1 but not on table 2 or table 3. For some reason my OR statement is not working.

SELECT [Table 1].LAST_NAME, [Table 1].MAILING_ADDRESS, [Table 1].CITY_TOWN
FROM ([Table 1] INNER JOIN [Table 2] ON [Table 1].ID = [Table 2].ID) INNER JOIN Table 3 ON [Clients 32503].ID = Table.ID
WHERE ((([Table 2].LAST_NAME) Is Null)) OR (((Table 3.LAST_NAME) Is Null));

Any Help

Pat
 
SELECT A.LAST_NAME, A.MAILING_ADDRESS, A.CITY_TOWN
FROM ([Table 1] AS A
LEFT JOIN [Table 2] AS B ON A.ID = B.ID)
LEFT JOIN [Table 3] AS C ON A.ID = C.ID
WHERE B.ID Is Null OR C.ID Is Null;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks PHV for your help with this issue. Code for queries works and I am done with this project.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top