Joining two queries...Please Help

C

Carlee

Hi there,
I have two queries that give me the information that i need. I want to join
these queries together to have the results show in one query, not two. I
need this because i have to use the results for invoicing purposes. 'Offer',
a fellow newgroup user, kindly provided this sql statement, but I am unsure
how to incorporate it into my scinario, using to queries.

Essentially, I have one table, tblPrintActuals. In one query I have all
print counts for the month of July, including the serial number for each
device. In the second query i have all print counts for the month of august,
including serial number for each device.

When I create a third query, using the 'find unmatched' wizard, I can get
those records that have an impression for july but not august. To get the
reverse, (those devices that have impressions for august that are not in
july.)

Issue, how can i get the results of both of these queries in one.

Many kind regards,
 
K

KARL DEWEY

Here I have pulled two months of data but you could do more by changing the
criteria in the second query to your number of months and the criteria in the
first for your date frame.

SELECT Format([Date open],"yyyy mmm") AS Monthly, [Change Requests].y
FROM [Change Requests]
WHERE ((([Change Requests].[Date open]) Between #7/1/2001# And #8/31/2001#))
GROUP BY Format([Date open],"yyyy mmm"), [Change Requests].y;

SELECT Query54.y, Count(Query54.Monthly) AS CountOfMonthly
FROM Query54
GROUP BY Query54.y
HAVING (((Count(Query54.Monthly))<2));
 
M

Michel Walsh

HI,



Use the queries as if they were tables, in the query designer (or from the
wizards).



Hoping it may help,
Vanderghast, Access MVP
 
D

David Lloyd

Carlee:

See my response to your previous post. If you have created two queries, one
for July with no match in August, and one for August with no match in July,
you can then UNION the two queries together to put them in one query. This
assumes each query has the same fields. For example:

QueryJulyWithNoAugustMatch.Field1, ...
UNION
QueryAugustWithNoJulyMatch.Field1, ...


--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


Hi there,
I have two queries that give me the information that i need. I want to join
these queries together to have the results show in one query, not two. I
need this because i have to use the results for invoicing purposes.
'Offer',
a fellow newgroup user, kindly provided this sql statement, but I am unsure
how to incorporate it into my scinario, using to queries.

Essentially, I have one table, tblPrintActuals. In one query I have all
print counts for the month of July, including the serial number for each
device. In the second query i have all print counts for the month of
august,
including serial number for each device.

When I create a third query, using the 'find unmatched' wizard, I can get
those records that have an impression for july but not august. To get the
reverse, (those devices that have impressions for august that are not in
july.)

Issue, how can i get the results of both of these queries in one.

Many kind regards,
 

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