2 queries 1 pivot

C

Clemens

I have a tabel with several fields.

1 field reports open date of a record and another field reports the close
time of a record (close time could be blank is record is not closed)

I have created a query where I count all records per year and per month
based on the field 'Open date'.

SELECT Year([Open Date]) AS Year, Month([Open Date]) AS Month,
Count(SCexport2.[Change No]) AS [CountOfChange No]
FROM SCexport2
GROUP BY Year([Open Date]), Month([Open Date])
ORDER BY Year([Open Date]);

I have created another query where I count all records per year and per
month based on another field 'Close Time'.

SELECT Year([Close Time]) AS Year, Month([Close Time]) AS Month,
Count(SCexport2.[Change No]) AS [CountOfChange No]
FROM SCexport2
GROUP BY Year([Close Time]), Month([Close Time]);

All records have an 'Open Date', but not all records have a 'Close Time'
(these records are still open). So the total count of the Open Date query
should report more records than the 'Close Time' query.

I can perfectly create a pivot chart based on 1 of these queries, but I need
to create 1 pivotchart where compare the amount of records with an 'Open
Date' next to the amount of records with a 'Close Time'


Is it possible to create a pivot table based on these 2 queries or is it
possible to combine these queries into 1 so I can show 2 values (counts) on a
timeline per month / year.
 

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