iif statement error#

  • Thread starter James G via AccessMonster.com
  • Start date
J

James G via AccessMonster.com

Hi........i have this simple iif statement in one of my queries..........

Category: IIf([childtype]=1,"Infant",IIf([childtype]=2,"Toddler","Elementary")
)

......can't get this to work.....can you tell me why??


Child type is a value in the table that helps the system distinguish between
different ages of children.......Infant, Toddler, and Elementary. thanks!
 
J

James G via AccessMonster.com

Don't worry about it guys.........i figured out what the problem was.......
the option group i was using .....was assigning the "Childtype" values as
Text not numeric........i used quotations and it fixed the problem....thanks
anyway
 
G

Guest

Might suggest using something like choose() in this situation. Looks like:


Category: choose([childtype],"Infant","Toddler","Elementary")
)


Makes life easier if that set of choices needs to expand in the future.
Drawback is that you need a value for each option as a sequence. So if you
had childtypes 1,2,4,8 your list would need 8 options, even if some were
empty strings.
 

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