• Status: Solved
• Priority: Medium
• Security: Public
• Views: 24691

# Crystal Reports if statement

Can you have more then one if statement in a formula in Crystal Reports 8.5?
IF InStr ({@Footnote},"A") < 1 then
'* A = Abnormal' + chr(13)
IF InStr ({@Footnote},"H") < 1 then
'* H = High' + chr(13)
and so on.....
0
sborchers
1 Solution

Commented:
Yes.  How you do it depends on the result you want.

Will only one of them be true? Try it this way

IF InStr ({@Footnote},"A") < 1 then
'* A = Abnormal' + chr(13)
ELSE IF InStr ({@Footnote},"H") < 1 then
'* H = High' + chr(13)
etc.

If you want multiple lines then do it this way
Local StringVar strResult := '';
IF InStr ({@Footnote},"A") < 1 then
strResult :=  strResult  & '* A = Abnormal' + chr(13)
ELSE IF InStr ({@Footnote},"H") < 1 then
strResult :=  strResult  & '* H = High' + chr(13)
etc.
ELSE IF LASTTest Then
strResult :=  strResult  & '* Last' + chr(13) ;
strResult

mlmcc

0

## Featured Post

Tackle projects and never again get stuck behind a technical roadblock.