I'm trying to use the if statement below to change the output if the value is null. When I run the report, it crashes and says the formula is invalid. In fooling around with it, it appears that the if statement is working so I though it might be a problem creating variables inside the if. I've tried defining the variable first and outside of the if statement with the same results.
Can someone please tell me why?
Here's the code:
If Not IsNull({TRANSITION_MASTER.ACTIONDATEM20}) or
Length({TRANSITION_MASTER.ACTIONDATEM20}) > 0 or
NUMERICTEXT({TRANSITION_MASTER.ACTIONDATEM20})
then (
Local NumberVar ActYr := ToNumber({TRANSITION_MASTER.ACTIONDATEY20});
Local NumberVar ActMo := ToNumber({TRANSITION_MASTER.ACTIONDATEM20});
Local NumberVar ActDay := ToNumber({TRANSITION_MASTER.ACTIONDATED20});
Local DateVar ActDate := Cdate(ActYr,ActMo,ActDay);
)
ELSE
(
Local DateVar ActDate := CurrentDate;
)
Can someone please tell me why?
Here's the code:
If Not IsNull({TRANSITION_MASTER.ACTIONDATEM20}) or
Length({TRANSITION_MASTER.ACTIONDATEM20}) > 0 or
NUMERICTEXT({TRANSITION_MASTER.ACTIONDATEM20})
then (
Local NumberVar ActYr := ToNumber({TRANSITION_MASTER.ACTIONDATEY20});
Local NumberVar ActMo := ToNumber({TRANSITION_MASTER.ACTIONDATEM20});
Local NumberVar ActDay := ToNumber({TRANSITION_MASTER.ACTIONDATED20});
Local DateVar ActDate := Cdate(ActYr,ActMo,ActDay);
)
ELSE
(
Local DateVar ActDate := CurrentDate;
)