Exclude records in qry1 if the same record ID is found in qry2 ..

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In short: I have two join query, qryJoinApproved and qry JoinPending. How can
I excluded rercords from showing in qryJoinApproved if the same record ID is
found in qryJoinPending.
 
Join the two queries, setting a Left Join (click on join line, set all from
A and only those from B ..) and set criteria for the join field in B IS
NOT NULL
 
David thank you for your replay, however I don't full understand the steps I
need to take, If you would please be more specific step-by-step (setting a
Left Join, click on join line?????)

Thank you,
Silvio
 
I am asuming minimal knowledge as I do not know what you know.
Open a new query in the normal query design window.
In the add tables dialogue select queries, and add your two queries.
Click on the record id in one query and drag it over the corresponding
record id in the other query and release the mouse button. (Drag and drop).
You should see a line joining these two fields. This is called a join. If
you look at it in SQL view you will see that it is an inner join. This query
will select all of the records that match.
Diouble click on that join line. A join properties window should appear.
Click on the option that gives you all of the records from the query that
you want and only those that match from the other.
If you look at SQL view you will see that this is now either a LEFT JOIN or
a RIGHT JOIN.
The record id from the ALL table will be present in all lines returned from
this query, whilst the record id in the "Only matched" table will sometimes
be NULL, because there is no record that matches.
A test for NULL in the record id of "Only matched" table will identify those
that do not have matches.
So IS NULL in the Criteria for that record id will identify the records
that you want, those that do not have a match.

I hope you can make sense of this explanation, it is late here, and I have
struggled a bit.

As long as you are not changing anything, it does not hurt to experiment and
look at the results and the SQL generated.. You will get a feel for it.
 
Back
Top