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!

Nested IIF Help

Status
Not open for further replies.

gretsch

Programmer
Aug 2, 2003
10
US
I am a VB programmer with very limited access reports experiance, how can i make this same IIF statement a nested one? =IIf([IndPTP]>1.25,"Y","N") eg:

if the Val is between 1.25 and 1.50 make the result A
if the Val is between 1.51 and 1.75 make the result B
if the Val is between 1.76 and 2.00 make the result C
if the Val is between 2.01 and 2.25 make the result D
if the Val is > 2.26 make the result E.

Not sure how to do this within the Control source of a field in a report..

HELP (again)
 
=IIf([IndPTP]>2.26, E,IIf([IndPTP]>2.01, D,IIf([IndPTP]>1.76, C,IIf([IndPTP]>1.51, B,IIf([IndPTP]>1.25, A, null)))))

That should do it...although I might be missing some parentheses, who knows. Hope that helps.

Kevin
 
I would not nest the IIf()s since I am old and get confused easily. A clearer solution would use the Switch() function or possibly Choose()
=Choose( ([IndPTP]-1)\.25,"A","B","C","D","E")

Duane
MS Access MVP
 
Bravo Sir! splendid work, go to the top of the class.

Gretsch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top