Link to home
Start Free TrialLog in
Avatar of g118481
g118481

asked on

Is it possible to streamline this query?

Hi,

I have this awful query that I would like to streamline, and add a where clause.
Any ideas?

SELECT *
FROM
table1
Where (firstout Between #MonthStart# and #MonthEnd#)
UNION all

SELECT *
FROM
table2
Where (firstout Between #MonthStart# and #MonthEnd#)
UNION ALL

SELECT *
FROM
table3
Where (firstout Between #MonthStart# and #MonthEnd#)

order by pk
Avatar of mrichmon
mrichmon

well in order to answer this question you will have to tell us what is included in the * in each table.... and how the tables are related.

It would also help to know what kind of data you are pulling.
ASKER CERTIFIED SOLUTION
Avatar of Tacobell777
Tacobell777

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of g118481

ASKER

The tables are not really related, but they do have the same field names.  The data is simple calendar data.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
exactly..