How to accurately combine two quarterly queries??

T

tlyczko

I have two queries, one which counts incidents for the current quarter,
and one which counts incidents for the immediately previous quarter.

QueryCurrentQuarter shows:
CurrentIncidentCount, IncidentType, Classification, ClassificationID
(for sorting), Qtr

QueryPreviousCurrentQuarter shows:
PreviousIncidentCount, IncidentType, Classification, ClassificationID
(for sorting), Qtr

How do I write a query which shows *accurately*

NewQuery:
CurrentIncidentCount, PreviousIncidentCount, IncidentType,
Classification, ClassificationID

Basically I need a side by side comparison of the unique counts of
incidents per quarter (calendar year) for each kind of Classification
(IncidentType can be repeated).

This is for printing a quarterly report.

I also have a different query which does give me the IncidentCount
numbers I want for each quarter within one query, but I don't know how
to separate out the data from that query either, so I went back to
working with two tables.

I searched this NG on 'comparison queries' and 'side by side
comparison' and didn't find what I'm looking for...

Basically I need a query from which I can produce a report that looks
like:

Classification 1: CurrentQuarterIncidentCount, LastQuarterIncidentCount
Classification 2: CurrentQuarterIncidentCount, LastQuarterIncidentCount
Classification 3: CurrentQuarterIncidentCount, LastQuarterIncidentCount

etc. etc.

My efforts to date give me too many rows (basically 1 row for almost
every combination of IncidentType and Classification), and
experimenting with the join types was not helpful either in getting
back the 'proper results' either.

Thank you, Tom
 
T

tlyczko

I have also tried a union query, which gets my data properly organized
without duplicate rows, etc., but does not allow me to present the data
in this format:
How do I write a query which shows *accurately*

NewQuery:
CurrentIncidentCount, PreviousIncidentCount, IncidentType,
Classification, ClassificationID

Basically I need a query from which I can produce a report that looks
like:

Classification 1: CurrentQuarterIncidentCount, LastQuarterIncidentCount
Classification 2: CurrentQuarterIncidentCount, LastQuarterIncidentCount
Classification 3: CurrentQuarterIncidentCount, LastQuarterIncidentCount

etc. etc.

I have also tried appending the results of my first two queries into a
temp table, but this results in fields having a value of 0, which is
not what I want for the list, and again too many rows...
Thank you, Tom
 

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