Is IndPTP a text field or numeric? Is it the result of a calculation in the report's record source? You might want to try:
=IIf(Val([IndPTP])>125,"YES","NO"
If that doesn't work, then check your data.
Data type shouldn't make any difference. It's probably the fact that it's a calculated control you are testing. You might try doing the calculation directly in your expression like this
OK great its wrking with the 1.25... next question:
I am a VB programmer with very limited access reports experiance, how can i make this same IIF statement a nested one? 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..
Something like this might work:
=Choose( (Val-1)\25,"A","B","C","D","E"
Make sure you use the "\" rather than "/".
My previous response should have been "\.25" not "\25".
However, I would probably create a lookup table with ranges and results. This would make the solution more "data driven" rather than "hard-coded".
As you can see my first try was wrong since I use 25 rather than .25. The integer divide would have worked with
=Choose( ((Val-1)*100)\25,"A","B","C","D","E"
And yes, values beyond 2.26 would have to be addressed with a longer expression such as
=IIf(Val>2.26,"E", Choose( ((Val-1)*100) \25, "A", "B","C","D","E"
My reply was a push in a direction and should have been more complete. In a similar thread I also suggested the Switch() function which is easier to maintain than multiple IIf()s.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.