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

Date Parameter problem

Status
Not open for further replies.

APB1981

Technical User
Jul 10, 2005
83
NO
Hello,

I am having a few problems with one of my date parameters:

I want the user to thave the option to either enter a date - or leave the parameter blank. If the param remains blank then I want a the following date to be displayed in the record:

31/12/9999


I have tried using the following code - But crystal 8.5 says that a boolean is required. This works fine with string formulas - any Ideas.

(
if not isnull ({?date_param}) then
{table.datefield} = {?date_param}
else
if if isnull ({?date_param}) then
cdate (9999,01,01)
)



Thanks in advance.

APB

APB

"Don't be a stranger - Just be strange
 
Try

if isnull ({?date_param}) then
cdate (9999,01,01) else
{table.datefield} = {?date_param}

HTH

-Steve


"if at first you don't succeed, sky diving is not for you"!!! :eek:)
 
Sorry - It still doesn't seem to work.

Crystal says that a date field must exsist here: {table.datefield} = {?date_param}

Any other ideas:

If the param is blank I want it to be set to 31/12/9999

APB


APB

"Don't be a stranger - Just be strange
 
Make sure the datatype of your parameter matches the datatype of the field. It looks like one of them might be a datetime field.

Why not just add your date to the parameter options list and make it the topmost (if using 8.x) or add your date as the default value if in higher versions. Then your record selection formula would look like:

if {?date} <> date(9999,12,31) then
{table.date} = {?date} else true

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top