Full Version: Exclude Values from a Query.
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
bmccallion
I have a table (tbl1) which stores certain values related from another table (tbl2). I want to Query (tbl2) but i want the query to exclude the values that are present in tbl1. I was wondering if anyone could help i am not having much success at the minute thanks.
kikovp
Hi and welcome to UA frown.gif

Assuming that the two tables are related thru a field named ID, you could use something like:

SELECT Table2.*
FROM Table2 LEFT JOIN Table1
ON Table2.ID = Table1.ID
WHERE Table1.ID Is Null;

Hope this helps
bmccallion
Yeah Worked A Treat thanks A lot!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.