Need Help on building an expression, first time expression builder

dxqwest

Registered User.
Local time
Today, 23:25
Joined
Aug 21, 2001
Messages
13
I have a question on building an expression
through the expression builder in my query or in my report or in VBA. I have a rating field which need to auto populate from a % to objective field. If the % to objective field is 99% or less then the rating field needs to auto populate to "D-Needs Development", if 114.9% or less then the rating field needs to auto populate to "M-Meeting Standards" and if 200% or less then it needs to auto populate to E-Exceeding Standards". I have tried IIf function in the expression builder through my report but I am not coding it in the right way for Access to give me the result.
 
iif (obj = 99 or obj < 99, "D-Needs Development", (iif( (obj >99 and obj < 114.9 ) or obj = 114.9, "M-Meeting Standards", (iif ((obj >114.9 and obj <200) or obj = 200, "E-Exceeding Standards)) ) )


obj >99 and obj <114.9 filters out obj that
are = 99 and obj that is greater or equal 114.99.

Since you need the "=" add the "or obj = 114.99.

(obj>99 and obj<114.99) or obj = 114.99

The parentheses forces the first condition to be tested first.




[This message has been edited by Liv Manto (edited 08-22-2001).]
 
iif (obj = 99 or obj < 99, "D-Needs Development", (iif( (obj >99 and obj < 114.9 ) or obj = 114.9,"M-Meeting Standards", (iif ((obj >114.9 and obj <200) or obj = 200, "E-Exceeding Standards)) ) )

Now do when I enter this in my VBA it gives me an error response of "Compile err Expected; list separator or )" then I fix the ) to make it look like this, iif (obj = 99 or obj < 99, "D-Needs Development"), iif(obj >99 and obj < 114.9 ) or obj = 114.9,"M-Meeting Standards"), iif (obj >114.9 and obj <200) or obj = 200, "E-Exceeding Standards)but then i get another err message saying "Compile err Expected:=". What am I doing wrong?

[This message has been edited by dxqwest (edited 08-22-2001).]
 

Users who are viewing this thread

Back
Top Bottom