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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiply If statements

Status
Not open for further replies.

PauloMongo

Programmer
Jul 16, 2001
80
GB
Can Crystal handle Multiply If statements

eg

If A > B then
if C > D then
E
else if
C < D then
G

Any Ideas
 
Crystal 8.5 has no trouble, I've used some quite complex nested IFs.

Do watch out for Null values, one complex command of mine which assembled customer details was failing in some cases because a date of birth was NULL in some cases. If it finds a NULL when it wasn't tested for, Crystal 8.5 will abandon the command without returning anything and without warning. Madawc Williams
East Anglia
Great Britain
 
Madawc makes some good points.

Also you can use Else without an if, and you might also add parens to improve readability:

If 2 > 1 then
(
if 4 > 3 then
'E'
else
'G'
)
else
'Default'

This can really help if you have more complexity.

-k kai@informeddatadecisions.com
 
synapsevampire,

&quot;Also you can use Else without an if&quot;

Did you reverse those? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top