简体   繁体   中英

Crystal Report If else on formula

I got an error for following formula on crystal reports.error is The remaining text does not appear to be part of the formula

Numbervar t:=0;
IF({GLTRANDE.GLTYPE} =1 OR {GLTRANDE.GLTYPE} =5 )Then
WhilePrintingRecords;
t:=tonumber({GLTRAN.CRDIFF})-tonumber({GLTRAN.DRDIFF})
//ELSE IF({GLTRANDE.GLTYPE}="2" OR {GLTRANDE.GLTYPE}="3" OR {GLTRANDE.GLTYPE}="4" )Then
else
WhilePrintingRecords;
t:=tonumber({GLTRAN.DRDIFF})-tonumber({GLTRAN.CRDIFF})

please give a advice for rectify this issue

Try making use of paranthesis and also add semicolon to the last statements of if and else

Numbervar t:=0;
IF({GLTRANDE.GLTYPE} =1 OR {GLTRANDE.GLTYPE} =5 )Then
(
WhilePrintingRecords;
t:=tonumber({GLTRAN.CRDIFF})-tonumber({GLTRAN.DRDIFF});
)
else
(
WhilePrintingRecords;
t:=tonumber({GLTRAN.DRDIFF})-tonumber({GLTRAN.CRDIFF});
)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM