Reputation: 1868
Version: Crystal Report 2008
I have 2 parameters that prompt the user to enter in information.
Parameter 1 (Boolean): Select All Time Periods? - True: Show all time periods - False: I will choose the date
Parameter 2 (date/time): Dynamic date time based on date/time field.
If the first parameter is true, then I want to omit parameter 2. If the first parameter is false, then I want to prompt the user for the date. Any idea on how to this?
Also, I have the following in my 'Record Select'
(if {?Select All Time Periods}= True then
date({ReleaseDate.ReleaseDate}) >= date(currentdatetime)
else if {?Select All Time Periods}= False then
date({?Select Release Date}) = {ReleaseDate.ReleaseDate})
Upvotes: 1
Views: 8816
Reputation: 7287
I would do away with the boolean parameter altogether. Keep your {?Select Release Date}, but set it to optional (available in CR 2008 and onwards). Then, put this in your record selection
if hasvalue({?Select Release Date} then
{ReleaseDate.ReleaseDate} = {?Select Release Date}
else {ReleaseDate.ReleaseDate} >= currentdate
By default, if a user does nothing with the parameters, only release dates in the future will be selected. If you truly want to select all release dates, past and future, you can simply omit the else-statement.
Upvotes: 2