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

Formula using two IIF statements

Status
Not open for further replies.

abacrystal

Technical User
Mar 1, 2004
2
US
Hello. I am very new to Crystal Reports and am trying to come up with a formula for a field. Let me see if I can explain this:

The original formula I came up with worked:

IIF ({rpt_UCOACourseSessions;1.NYTrans}="Y" AND{rpt_UCOACourseSessions;1.CLEArea}="General", "Areas of Professional Practice",(rpt_UCOACourseSession;1.CLE Area})

Now I need to put another condition into the field which would read:

IIF ({rpt_UCOACourseSessions;1.NYTrans}="Y" AND {rpt_UCOACourseSessions;1.CLEArea}="Elimination of Bias", "Law Practice Management", (rpt_UCOACourseSessions;1.CLEArea})

We can't seem to come up with a formula that will meet both of these conditions. It is most likely because we don't know the proper syntax rules. Can anyone help me out with this? Let me know if you need further information.

Much appreciated,

The Rookie
 
You can do it within a IIF but since you're having difficulties, improve the readability by just using an IF statement:

IF ({rpt_UCOACourseSessions;1.NYTrans}="Y" AND {rpt_UCOACourseSessions;1.CLEArea}="Elimination then
Bias"
else if {rpt_UCOACourseSessions;1.CLEArea}="General" then
"Areas of Professional Practice"
else if
{rpt_UCOACourseSessions;1.CLEArea}="Elimination of Bias" then
"Law Practice Management"
else
(rpt_UCOACourseSessions;1.CLEArea})

Makes it easier to edit and the performance is essentially the same.

Not sure if I've gottent eh syntax correct, or the rules as the second IIF posted seemignly hadn't taken all of the possibilities into consideration

-k
 
Thanks. We went to Excel and figured out the logic from there. Thanks for your help.

ac
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top