Try presetting a value for the date range, such as 1/1/1970, then use something like the following:
(
If minimum({?MyDate}) <> cdate(1970,1,1) then
{table.date} = {?MyDateParm}
else If minimum({?MyDateParm}) = cdate(1970,1,1) then
true
)
and
(
{table.product} = {?MyProductParm}
)
Note that the full ELSE IF....TRUE qualification helps to assure SQL pass through so don't shortcut this.
you really don't say WHY you want this parameter to be optional.
SV has given an excellent instruction for when you want to limit records. However another use of parameters is to control the Grouping of a report.
For example sometimes you may wish the report to be grouped by date as a secondary grouping and sometimes not.
Eg
Group 1 (by {Table.product})
Group 2 (by {Table.date} or no grouping...user option)
For this situation we would create the following grouping formula (using SV's format for the date parameter)
//@Group2
If minimum({?MyDate}) <> cdate(1970,1,1) then
totext({table.date},"yyyyMMdd"
else
"No Group";
We convert the date to a string so we can have a string value constant if no grouping is desired.
Now in the Group header and footer we want to suppress these sections so in the Section Expert for the Group 2 header and footer in the conditional suppress we place the formula
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.