iif statement on another calculated field?

  • Thread starter Thread starter lmw
  • Start date Start date
L

lmw

is there something wrong with this? could it be that the field [DocAge] that
I am comparing is another calcualted field?

=iif( [DocAge] Between 0 And 15,"0-15â€, iif( [DocAge] Between 16 And 30,
“16-30â€, iif( [DocAge] Between 31 And 60,"31-60â€, iif( [DocAge] > 60,"61+",
“NAâ€))))
 
I wouldn't attempt to create an expression with hard-coded values like this.
It would be best to create a small lookup range table with min, max, and
title fields. If you don't want to create a table, consider a small
user-defined function that accepts the age and returns the range title.

If DocAge is calculated, it might be returning a variant string which might
cause unexpected results.
 
Why is there an equal sign at the beginning of the statement and why do you
think that there is something wrong with this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

IIF expresion 6
nested iif 5
IIf statement Query 17
Iif Statement 5
is there a better way? 3
First value below zero in a column 1
calculating sums 21
IIF Statement to calculate aging buckets 7

Back
Top