Need expression help in Query

  • Thread starter Thread starter JoeL
  • Start date Start date
J

JoeL

Hello.
I am attempting to have an expression that looks at a
value and if it's >59 then output "High", between 29-60
then "Medium" and if between 0-30 then "Low". This is
what I've written in the Field field:

Rating: If([PWT Score]>59,"High",If([PWT Score]
29,"Medium",If([PWT Score]>0,"Low")))

Any help would be appreciated.
Thanks,
Joe
 
Dear Joe:

I recommend using "Immediate If" for this:

Rating: IIf([PWT Score] > 59, "High", IIf([PWT Score] > 29, "Medium",
"Low"))

Your written description is ambiguous as to what you would want for
60, 29, or 30. 60 would be both "High" (being > 59) and "Medium"
(being between 29-60) and 29 and 30 are both between 29-60 and also
0-30. So the above may not be exactly correct, depending on what you
really meant, so adjust the numbers if necessary.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts

Hello.
I am attempting to have an expression that looks at a
value and if it's >59 then output "High", between 29-60
then "Medium" and if between 0-30 then "Low". This is
what I've written in the Field field:

Rating: If([PWT Score]>59,"High",If([PWT Score]
29,"Medium",If([PWT Score]>0,"Low")))

Any help would be appreciated.
Thanks,
Joe
 
Back
Top