Here is an example using the Extreme database. If you add in an impossible statement, the first half of the union will not execute.
SELECT `Customer`.`Customer ID`,
`Orders`.`Customer ID`,
`Orders`.`Order Date`,
`Customer`.`Customer Name`
FROM `Customer` `Customer`
left join `Orders` `Orders` on
`Customer`.`Customer ID`=`Orders`.`Customer ID`
where
(
(
'{?All or Current}'='All' and
1=2
)
or
(
'{?All or Current}'='Current' and
`Orders`.`Order Date`>={?StartDate}
)
)
union all
SELECT `Customer`.`Customer ID`,
null,
null,
`Customer`.`Customer Name`
FROM `Customer` `Customer`
where '{?All or Current}'='All'
You can adapt this to your needs.
It looks like you are didn't use only the command as your datasource. You must ONLY use the command, not a selection statement in the main report, and that is why I also mentioned that you must create the parameters within the command screen. If you use a command and also a selection statement in the main report, the report will only run locally with tons of records.
-LB