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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Entering nothing or blank values for a parameter

Status
Not open for further replies.

susanna123

Technical User
Jan 22, 2010
79
CA
I currently have a start and end time parameter and a processing time parameter.
Is there a way to allow it so that these fields can be left blank and when the report runs, it will run for all records.
 
If you're using Crystal Reports 2008, select the "Optional Prompt" and use the HasValue formula function.

If not, then it takes some formula coding to work around it.

"Crystal Reports Formulas Explained" is the most advanced book on the market. Currently available with a free 70 page Crystal Reports XI tutorial:
 
this version is crystal reports 11.5.11.1470. How can the coding be done. Can you provide an example?
 
You need to set default date values for the parameters, then make their use conditional with an if statement.

Something like:

IF {?ParameterDate} = #1066,01,01# THEN
TRUE
ELSE
{Database.DateFieldYouCareAbout} > {?ParameterDate};

Assuming you are using it for record selection and the ELSE is the comparison you want.

Be warned: this can make a report slow.

"Crystal Reports Formulas Explained" is the most advanced book on the market. Currently available with a free 70 page Crystal Reports XI tutorial:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top