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

IF statements not evaluating

Status
Not open for further replies.

records333

Technical User
Mar 16, 2012
41
US
During validation, I've notice that the formula is only evaluating the first statement not the OR STATEMENTS. Please see example:

IF (
({Command_DATE} in DateTime (2013, 07, 01, 00, 00, 00) to DateTime (2013, 12, 31, 00, 00, 00) AND {Command_ORDER.DESCRIPTION} like "XXX*" )

OR ({Command_CLASSES.DATE} in DateTime (2013, 07, 01, 00, 00, 00) to DateTime (2013, 12, 31, 00, 00, 00) and {Command_CLASSES.NAME} like ["*AAA*","BBB*","CCC*"])

OR ({Command_VIDEO.DATE} in DateTime (2013, 07, 01, 00, 00, 00) to DateTime (2013, 12, 31, 00, 00, 00) AND {Command_VIDEO.ID} = "27479")
)

THEN 1 ELSE 0


 
The only thing that comes to mind is if there are nulls in the data. That will mess up the formula. Do you have 'Default Values for Nulls' selected in the Formula Editor?
 
I modified report to the following:

IF (
({Command_DATE} in DateTime (2013, 07, 01, 00, 00, 00) to DateTime (2013, 12, 31, 00, 00, 00) AND {Command_ORDER.DESCRIPTION} like "XXX*" )

OR ({Command_CLASSES.DATE} in DateTime (2013, 07, 01, 00, 00, 00) to DateTime (2013, 12, 31, 00, 00, 00) and {Command_CLASSES.NAME} like ["*AAA*","BBB*","CCC*"])

OR ({Command_VIDEO.DATE} in DateTime (2013, 07, 01, 00, 00, 00) to DateTime (2013, 12, 31, 00, 00, 00) AND {Command_VIDEO.ID} = "27479")
)

THEN 1 ELSE 0

then {patient.pat_id)

else {@null}

I received an error that the keyword 'then' is missing
 
I noticed that after the then the field {patient.pat_id[highlight #75507B])[/highlight] should have a closing bracket {patient.pat_id}. I do not know if that is the source of the error. But it is the only thing that stands out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top