Joining 3 tables in a query

C

Chrismja

I am joining 3 tablesin a query, but it's only pulling matching records in
the tables, and there are some unique records I also need it to pull. I'm
sure there is a way to do this, but I don't know how. Here's the situation:
I have a table named "Total Inventory" and I have 2 other tables that
include incentives for 2004 models and 2005 models. I have a query that that
has these 3 tables joined via joining "2004 incentives.body code" to "Total
Inventory.Model Code" (which are the same thing), then on the other side I
also have 2005 incentives table joined to "Total Inventory" via "2005
Incentives.body code" to "Total Inventory.Model Code" . My problem is this:
The query pulls all the records from inventory that has a matching model
code to the "body codes" in the 2 incentive tables with the exception of
"body codes" that are only listed in either the 2004 or 2005 incetive
tables. In other words the "body code" must be listed in both 2004 and 2005
Incentive tables in order for the query to pull the matching records.
However there are some "body codes" that are only found in either the 2004
or in the 2005 incentive table. How can I make this query pull all of the
records that have a match in "Total Inventory" if they don't have a match in
the other incentive table? I have already tried changing the relationships
to left join or right join, but both of these give me an error that says:
the SQL statement could not be executed because it contains ambiguous outer
joins. Does anyone have any suggestions?
 

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