Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-07-13
3
Medium Priority
?
4,232 Views
Last Modified: 2012-08-14
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!
0
Comment
Question by:bshelby777
3 Comments
 
LVL 17

Accepted Solution

by:
pssandhu earned 1800 total points
ID: 24841951
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
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 200 total points
ID: 24856171
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
 

Author Closing Comment

by:bshelby777
ID: 31602921
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

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question