iif statement on another calculated field?

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â€))))
 
D

Duane Hookom

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.
 
S

Sylvain Lafontaine

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

nested iif 5
IIF expresion 6
IIf statement Query 17
is there a better way? 3
IIF statement in query calculated field 5
IIF statement in query criteria, help! 2
iif statement 4
Using NULL 1

Top