Union Query with 3 tables

G

Guest

I'm trying to use a Union query with 3 tables to combine the following
fields. Not all customers have a territory or broker; however, I would like
al lthe customers listed in the output. Thanks for any help

Customer Number from table 1
Territory Name from Table 2
Broker from table 3
 
G

Guest

What you are looking for is not a UNION query. A UNION query merges like
data from multiple record sources into a single result set. In my
experience, it's most common use is to normalize a poorly structured database.


I believe what you want to do is create a query that links your Customer
table (Table1) to the Territory table (table2) and the Broker table (table3).
You have not indicated how these tables are related, so it is difficult to
answer your question. If you provide a little more information about your
table structure, you will get considerably more help. At this point, all we
can do is speculate.

If I were designing this database, I would probably have a Customer table,
that contains a CustomerID field, it might also have a ZipCode or some other
indicator to indicate what Territory the customer resides or does business
in. The Territory table, IMHO, would probably contain specific information
about territories (maybe ZipCodes or TerritoryID and would have some sort of
description field, like "S.W. Illinois"). The Brokers table might have a
TerritoryID field, or if a Broker is responsible for more than one territory,
you might also have a BrokerTerritory table which would give you the ability
to assign brokers to multiple territories.

If you provide a little more information about your table structure, you
will get considerably more help. At this point, all we can do is speculate.

Dale
 
G

Guest

HI Dale to better explain what I'm trying to accomplish:

The customer number Territory and Broker are in all 3 tables. The customer
Number is the related field in all 3 tables. Table 1 has all the customers
listed however tables 2 and 3 don't have all the customers and the broker and
territory will be different in tables 2 and 3.

My goal is to bring the territory and brokers from tables 2 and 3 into table
one for each customer under one field for Territory and ine Field for Broker.

When I use a select query it returns tow territory and two broker fields.

again thanks for nay help
 

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