grahamcorp
asked on
Checking data parameter is empty or null
Hi,
I have a crystal report in which I want to allow the user to enter a date parameter, but if they don't I want to put in place a default date range.
My current code is attached. I know I can't do the '' as the forumla expects a date type so won't compile and most likely the isnull is really only for checking database values, so thats prob out too, but it gives an idea of what I want to do.
I have a crystal report in which I want to allow the user to enter a date parameter, but if they don't I want to put in place a default date range.
My current code is attached. I know I can't do the '' as the forumla expects a date type so won't compile and most likely the isnull is really only for checking database values, so thats prob out too, but it gives an idea of what I want to do.
//If no start date was given, then run the report for the reportPeriod of months from the given endDate.
if ( isNull({?Start_Date}) OR {?Start_Date} = '' ) Then
( Date(DateAdd ("m",-{?reportPeriod_Months},cDate(year({@EndDate}), month({@EndDate}), 01))) )
else
{?Start_Date};
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks James,
I had a funny feeling this was going to be the case, so have change the report, instead of taking it a start and end date it will now take in a month time period and the report itself will work out the start and end dates.
I had a funny feeling this was going to be the case, so have change the report, instead of taking it a start and end date it will now take in a month time period and the report itself will work out the start and end dates.
Glad I was able to help, even if it was only to tell you "you can't get there from here". :-)
James
James
James