Crystal reports IF <VALUE> IN <LIST OF VALUES> THEN DO SOMETHING

I just need the exact code to specify the following (in a sort-of pseudocode)

if DBfield is in ("ABC", "XYZ","RST") then     <-- This is the problem
  do something
else
  do something else

I can't find how to specify the IN.  IN RANGE doesn't work.  I saw it somewhere else where it had IN and then there was another keyword after the list of values and before the THEN, but I can't find it.  Help!
bshelby777Asked:
Who is Participating?
 
pssandhuCommented:
Something like this (you have to put the values in a square bracket):
IF DBFiled IN ["ABC","XYZ"] Then "This is the Problem"
ELSE "This is okay"
Hope this helps.
P.
0
 
mlmccCommented:
Looks good.

WHat you might have seen was the BASIC syntax

IF DBFiled IN ARRAY ["ABC","XYZ"] Then
    "This is the Problem"
ELSE
    "This is okay"

mlmcc

0
 
bshelby777Author Commented:
I gave pssandhu 450 points because that was the first correct answer.  I gave 50 to mlmcc because that may be what I saw before and it's good to know that it's equivalent.  Thank you both very much.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.