Union Query of Two Queries (Part 2)

  • Thread starter Thread starter joave
  • Start date Start date
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
 
Hi:

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

Thank you,

Dave
 
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;
 
Back
Top