Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting data stored numerically to Words in a report

Status
Not open for further replies.

cmcdonald

Technical User
Aug 2, 2000
11
EU
I have a table of customer orders whose order status is stored in a table as one of six or seven different numbers, each representing a different status. ie: 20 = Ready, 30=Pending, 40=Complete, etc.

I am unable to change the way they are stored in the table, but I would like to display the words they represent in a report rather than just the numbers. I can do this using the IIf function for just two options, but I am stumped on more than two.

Any ideas?
 
Try using a nested iif:

iif(comparison, valueIfTrue, iif(comparison, valueIfTrue, iif(comparison, valueIfTrue, iif(comparison, valueIfTrue, etc.))))

so, for your case it would be:
iif([Status] = 20, "Ready", iif([Status] = 30, "Pending", iif([Status] = 40, "Complete", "KeepGoing")))

hope this helps.
 
Thanks! I feel silly for not working this out, but at least it's done now.

Cheers,
Cara
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top