Find data not in a tables field (1 Viewer)

oxicottin

Learning by pecking away....
Local time
Today, 10:32
Joined
Jun 26, 2007
Messages
851
Hello, I have a table (tbl_Inches) with a field (inValue) and I want to create a query that will check a table (tbl_MachineOutput) field (SLegCS) for data that is not in the (inValue) field. How is that done?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:32
Joined
May 7, 2009
Messages
19,169
you can use Query:

select tbl_MachineOutput.SlegCS Frrom tbl_MachineOutput
Left Join tbl_Inches
On tbl_MachineOutput.SlegCs = tbl_Inches.inValue
where tbl_Inches.InValue Is Null;
 

oxicottin

Learning by pecking away....
Local time
Today, 10:32
Joined
Jun 26, 2007
Messages
851
you can use Query:

select tbl_MachineOutput.SlegCS Frrom tbl_MachineOutput
Left Join tbl_Inches
On tbl_MachineOutput.SlegCs = tbl_Inches.inValue
where tbl_Inches.InValue Is Null;
Thank you!
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 09:32
Joined
Feb 28, 2001
Messages
26,999
Though arnelgp's SQL is ABSOLUTELY correct, there are other ways to do this. For instance,

Code:
SELECT SlegCS FROM tbl_MachineOutput
WHERE SlegCS NOT IN (SELECT inValue FROM tbl_Inches) ;

This method is a sub-query. Arnel's method is a JOIN query.
 

Gasman

Enthusiastic Amateur
Local time
Today, 14:32
Joined
Sep 21, 2011
Messages
14,044
Couldn't you just use the Unmatched query wizard optin?
 

Users who are viewing this thread

Top Bottom