Find unmatched query

G

Guest

I used the Find Unmatched Query Wizard to create a query. Now I'm trying to
understand what it did.

There are two tables in the table window with a 1 to many relationship. On
the many end of the relationship line there is a small arrow. I have never
seen this before. What does it mean?

Regards,
Seth
 
G

Guest

If you right-click the join line and click Join Properties, it will be
explained.

Lets say you have a Customers table (one) to Invoices table (many), joined
on the CustomerID field. Let's say you output just CustomerID & InvoiceID
from your query.

If you use an equal join (no arrow on the line), you will get a report
showing only those customers that have invoices, along with the invoices.

If the arrow points to the CustomerID in the Invoices table, you will see
all customers, including those that have no invoices. Those that have
invoices will have one line for each invoice; those that have no invoices
will have a single line, but the InvoiceID will be blank.

Now, all you have to do is set a criteria of Null for the CustomerID in the
Invoices table, and you will see ONLY those customers with no invoices.

If the arrow points to the CustomerID in the Customers table, you will get
all invoices, even those not attached to a customer (whcih should never
happen with good referential integrity). Thus, you will get one line for each
InvoiceID, but the CustomerID will be blank on those lines for which there is
no CustomerID on the invoice.

Now, all you have to do is set a criteria of Null for the CustomerID in the
Customers table, and you will see ONLY those invoices with no customer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top