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

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
Asked:
sborchers
1 Solution
 
mlmccCommented:
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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