combine queries

T

TY

How do I combine two queries into one report? I have a
crosstab query which counts all orders per empolyee and
another query that counts all orders per employee where
service level > 3600. How do I create a report that will
show at least these three columns: "Employee
Name", "Total number of Orders" and "Total number of
Orders where Service Level>3600".
 
T

Tom Ellison

Dear TY:

Perhaps if you post the SQL to the two queries you have, something
specific could be figured out.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
T

TY

The two queries are almost the same. The difference is
the "AND ((sqryAllData.temptimepsent)>3600)" statement in
the first.

This is the first of them:
PARAMETERS [Enter Rep Location] Text, [Enter beginning
date] DateTime, [Enter ending date] DateTime;
TRANSFORM Count(sqryAllData.[Case ID+]) AS [The Value]
SELECT sqryAllData.[Individual+], Count(sqryAllData.[Case
ID+]) AS [Total Of Case ID+]
FROM RepList INNER JOIN sqryAllData ON RepList.
[Individual+] = sqryAllData.[Individual+]
WHERE (((RepList.RepLocation)=[Enter Rep Location]) AND
((sqryAllData.[Arrival Time]) Between [Enter beginning
date] And [Enter ending date]) AND
((sqryAllData.temptimepsent)>3600))
GROUP BY sqryAllData.[Individual+]
PIVOT sqryAllData.Category In ("XHD:BTO");

This is the other:
PARAMETERS [Enter Rep Location] Text, [Enter beginning
date] DateTime, [Enter ending date] DateTime;
TRANSFORM Count(sqryAllData.[Case ID+]) AS [The Value]
SELECT sqryAllData.[Individual+], Count(sqryAllData.[Case
ID+]) AS [Total Of Case ID+]
FROM RepList INNER JOIN sqryAllData ON RepList.
[Individual+] = sqryAllData.[Individual+]
WHERE (((RepList.RepLocation)=[Enter Rep Location]) AND
((sqryAllData.[Arrival Time]) Between [Enter beginning
date] And [Enter ending date]))
GROUP BY sqryAllData.[Individual+]
PIVOT sqryAllData.Category In ("XHD:BTO");
 
T

Tom Ellison

Dear TY:

I had thought it might be apparent from your queries what you meant by
"combine" them, but it's not.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 

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