Union Query of Two Queries (Part 2)

J

joave

Hi:

I almost have this problem resolved thanks to the wonderful people on this
forum. My last question is this: I have a Union Query of two queries - each
of the two queries asks for a [Start Date] and an [End Date]. Therefore the
Union query asks for the start date and end date TWICE :( How to make the
Union query run while only asking for those dates once?

Here is the Union Query:

SELECT 1 as Q, ID, Name, Sent, Connected from Location1MonthlyQuery
UNION ALL SELECT 2, ID, Name, Sent, Connected from Location1ZeroSentQuery
ORDER BY Q, Location1MonthlyQuery.Connected DESC ,
Location1MonthlyQuery.Sent DESC;

Thank you,

Dave
 
J

joave

Hi:

This post has been answered in my previous post. I apologize for the
repeat issue.

Thank you,

Dave
 
K

Ken Snell MVP

Try this:

PARAMETERS [Start Date] Date, [End Date] Date;
SELECT 1 as Q, ID, Name, Sent, Connected from Location1MonthlyQuery
UNION ALL SELECT 2, ID, Name, Sent, Connected from Location1ZeroSentQuery
ORDER BY Q, Location1MonthlyQuery.Connected DESC ,
Location1MonthlyQuery.Sent DESC;
 

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