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

How to make date parameter optional?

Status
Not open for further replies.

ekta22

IS-IT--Management
May 3, 2004
359
US
Hi,

I am using Crystal XI

I have two date parameters on my report and I want to be able to make them optional. Currently, crystal forces me to enter the date.

How can I do this?

Thanks,

E
 
Hi,
You could make the parameters text instead and use a conversion formula to use them as dates (supply a default value to show the format you want and test for it in your selection formula if no dates are needed)..

Like:
If this
{?DateStringParam} = 2009,01,01

then in your selection formula you could use something like:
Code:
If {?DateStringParam} <> '1900,01,01' [COLOR=green]//your default to ignore date [/color]
then
{Table.DateField} = Date({?DateStringParam})



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Or you could just use a date that is out of range, as in:

(
(
{?date} <> date(9999,9,9) and
{table.date} = {?date}
) or
{?date} = date(9999,9,9)
)

You would have to add prompt text directing the user that if they don't want to limit the records by date they should enter 9999-9-9.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top