Union query joins tables, need to insert zero where data doesn't e

G

Guest

I have a database that tracks problems from vendors. It uses many tables from
different sources for each problem. I need to capture all of these into one
report, graph each problem seperatly by month and provide a 3-month average
for each problem and give an overall score. I join all my tables using a
union query to result in the following:

Date Supplier Problem Demerit

I then group the date by month in the crosstab query.

The issue I have is that not every table includes a score for every supplier
for every month and if they don't exist then their problem graph will look
poor. Thus I need to somehow run a query or code to ensure that every
supplier is listed for every problem for every month and they are given a
score of zero. Any ideas??
 
G

Guest

Sorry everyone, I was able to resolve my issue by running a regular query on
my union query and performing an iif(score=null,0,score) to populate the
fields
 
J

John W. Vinson/MVP

The issue I have is that not every table includes a score for every
supplier
for every month and if they don't exist then their problem graph will look
poor. Thus I need to somehow run a query or code to ensure that every
supplier is listed for every problem for every month and they are given a
score of zero. Any ideas??

Use a "Left Outer Join" to connect the supplier table to the scores.

John W. Vinson/MVP
 

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