Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports 11 - Make Date Range Optional

Status
Not open for further replies.

BSSME

MIS
Dec 8, 2005
16
US
I'm working with Crystal Reports 11 and I needed to add a couple parameters to a report. However, these parameters need to be optional. As it stands two date parameters I added are currently required as the prompt dialog will not run the report without the dates being filled in.

How do I go about making the Beginning Date and Ending Date parameters optional in the prompting?
 
Have three parameters - one to decide whether to have a date range, the other two to specify.

Refer to all three in a formula field: is it all dates or any date within the range.

Make this a 'boolian', no 'IF', so it is true or false and can be invoked by using its name in the selection criteria.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thank you very much as ths is very helpful so far. Can you give me an example of the formula?
 
Wouldn't this work as well?

(If (not isnull({?YOUR_PARAMETER_NAME}))then {TABLE_NAME.FIELD_NAME}={?YOUR_PARAMETER_NAME}
else true)

-- Jason
"It's Just Ones and Zeros
 
If you set up the parameter as a range ("allow range values") and then enter a default of: 1/1/1970, you can then set up your record selection formula like this:

(
if {?range} <> date(1970,1,1) then
{table.date} in {?range} else
if {?range} = date(1970,1,1) then
true
)

This will pass to the SQL also.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top