Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple IF result statements

Status
Not open for further replies.

NGonz

Technical User
May 12, 2001
13
US
Hello All,

I'm sure there is a way for an IF statement (using Crystal syntax) to have multiple results.
For example:
If <True> then
Do step 1
Do step 2
Else
If . . .

I'm sure this can be done I'm just missing something. I've tried a few different things but don't get the results I want (actually I get errors). Does anybody have any suggestions?

Any help would be appreciated,
Thanks,
NGonz
 
Depends on what you mean by &quot;do something&quot; since the only action that can be taken by a formula is to modify a variable value.

If you are making assignments to variables in CR syntax see my FAQ on common formulas. It will show you how to make multiple assignments in one If-Then step.

Otherwise, CR Formulas simply calculate a value, and they can't calculate 2 different values, just one.

Post an example of your formula if you need more help. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Hi NGonz,

I presume what you are looking for is:-

If a=b then (do1;do2;do3)
else do4;

The basic principal is to add brackets round the complete expression with semi-colons between each command.

Geoff
 
Thanks to both of you.
That's exactly what I was looking for. I don't recall seeing this explained in the manual.

Thanks again,
Ngonz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top