Multiple expression, in Query

W

Woos

iif ([age] <30, ".08"
between 31 AND 34, ".10"
between 35 AND 39, ".15"
between 40 AND 44, ".25"
between 45 AND 49, ".43"
between 50 AND 54, "1.04"
between 55 AND 59, "1.10"
between 60 AND 64, "1.90"
65, "N/A"

I'm trying to create an expression that will return these results based on
the age column of a table.
Any ideas would really be helpful

If I remember correctly, IIF can only do 2 comparisons, what do I use for
multiples like the one above?
 
M

[MVP] S.Clark

I would create a Table like the following:

tlkpAgeThings
ATID
AgeStart
AgeEnd
AgeFactor

Whenever I need the factor, I would use a query to determine the factor for
each needed age.


--
Steve Clark, Access MVP
http://www.fmsinc.com/consulting
*FREE* Access Tips: http://www.fmsinc.com/free/tips.html

Woos said:
iif ([age] <30, ".08"
between 31 AND 34, ".10"
between 35 AND 39, ".15"
between 40 AND 44, ".25"
between 45 AND 49, ".43"
between 50 AND 54, "1.04"
between 55 AND 59, "1.10"
between 60 AND 64, "1.90"
65, "N/A"

I'm trying to create an expression that will return these results based on
the age column of a table.
Any ideas would really be helpful

If I remember correctly, IIF can only do 2 comparisons, what do I use for
multiples like the one above?
 

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

Top