Solved

Only include rows that do not exist in 2nd query

Posted on 2013-06-18
2
285 Views
Last Modified: 2013-06-18
I am using Microsoft Access with ODBC tables

I have 2 queries that query the same tables but with different criteria.
I'd like the 1st query to only include records that do not exist in my 2nd query.
How do I achieve this?

Both queries include Names and a reference number.
Query 1 should only include all rows where the reference number does not exist in any rows in the 2nd query.
0
Comment
Question by:antonioking
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39256997
try this query

select *
from query1 as q1 left join query2 as q2
on q1.[reference number]=q2.[reference number]
where q2.[reference number] is null
0
 

Author Closing Comment

by:antonioking
ID: 39258011
Thank you!
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question