Exclusion query

  • Thread starter Thread starter Rob Mazur
  • Start date Start date
R

Rob Mazur

I am trying to create a query that says if it's in
database a, but not in database b, show me the results.

I've been struggling with this for a couple of days now,
any ideas?

Rob
 
Rob Mazur said:
I am trying to create a query that says if it's in
database a, but not in database b, show me the results.

I've been struggling with this for a couple of days now,
any ideas?

Rob

I assume you have linked the table in database b to database a, so that you
can see both tables in a query.

Then, link the tables with a join property that shows all the records in a,
and set the criteria to Null on the field from b.

David
 
Is this accomplished within the query or through the
relationships dialog box. Do I even need to setup a
relationship between the two databases?
 
I am trying to create a query that says if it's in
database a, but not in database b, show me the results.

I've been struggling with this for a couple of days now,
any ideas?

Rob

I presume you mean TableA and TableB? A "database" in Access jargon is
the .mdb file, containing multiple tables/forms/reports etc.

There is an Unmatched Query Wizard that will do this for you, or you
can write your own "frustrated outer join" query:

1. Add TableA and TableB to the query grid
2. Join them by the appropriate linking field (I don't know what that
is in your table but typically it would be the Primary Key of TableA
and a matching Foreign Key in TableB)
3. Select the Join line by clicking on it, and choose Option 2 (or 3)
- "Show all records in TableA and matching records in TableB"
4. Select any fields you want to see from TableA, and *only* the
joining field from TableB
5. Put

IS NULL

on the criteria line under the TableB joining field
6. Open the query.
 
Yes, tableA and TableB, sorry about the confusion.

Can't seem to find the Unmatched query. Access keeps
prompting me for a relationship setting. I will try it
the hard way, unless you have any other ideas.

Rob
 
Back
Top