Unmatched query

  • Thread starter Thread starter Raoul Za
  • Start date Start date
R

Raoul Za

Guest
Hi

I am having a problem trying to make my query work.

I have two tables, with almost identical information on them for an audit report.

What I need is the correct code to make the report output the identity and location of a p.c. where it is not found on the other table

i.e. table 1.id not in table 2.id

theoretically I should be getting a few results at least because I have set up the test data to do this, but the output report is showing nothing.

can anybody help me, or advise me on the correct code to use in the selection criteria please?

thanks

za
 
while im here - my unmatched query wizard is not installed. gods i love company set up pc's.
 
The query created by the Find Unmatched Wizard is:-

SELECT DISTINCTROW [Table1].[ID], [Table1].[Identity], [Table1].[Location]
FROM Table1 LEFT JOIN Table2 ON [Table1].[ID] = [Table2].[ID]
WHERE ([Table2].[ID] Is Null);


Instead of using LEFT JOIN, you can also use a subquery:-

SELECT ID, Identity, Location
FROM Table1
WHERE ID not in (Select ID from Table2);
 
Jon


You are a saint.

You might not have saved my career but you sure as hell got my access query working.

Thanks

Za
 

Users who are viewing this thread

Back
Top Bottom