Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Nesting IIF(), is this possible
Message
From
22/08/2001 11:50:44
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
22/08/2001 11:40:51
Connie Taylor
Thousand Trails/Naco & Liesuretime Resor
Gautier, Mississippi, United States
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00547335
Message ID:
00547347
Views:
8
>I am using the IIF() to get a value for a field in a report and need to nest the IIF(). Can this be done?
>The expression I am using for a field in a report goes something like this:
>
>IIF(hank.pla_level = '1st', IIF(HANK.PLA_WITH = 'Ideal',ROUND(HANK.AMOUNT *.3,2), ROUND(hank.amount*.275,2)), ROUND(hank.amount*.5,2))
>
>It looks good to me, however my logic may have a flaw I cannot find or nesting this type of expression may not be valid... I keep getting a 'syntax error'. I am sure there is an easier way to accomplish my goal, however, I would really like to know if nesting the IIF is possible and what I could be doing wrong? Any ideas would be great!
>
>Also, I am new at this please be kind :)

Yes, iif() can be nested. Expressions can get quite complicated. For debugging, try breaking into smaller pieces (add one condition at a time). Or create a function with a DO CASE instead - this will be more readable.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform