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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIf Statement

Status
Not open for further replies.

ba4crm

Technical User
Dec 19, 2003
92
US
Hi,
I have a status that has the following indicators F0 to F8.
F0 = Cancelled
F1,F2 = Approved
F3 = Partially Approved
etc (the rest of the indicators each equate to one status only)

In my query, I would like to display the status (Approved, cancelled) for each of the indicators and also combine F1 and F2 to display "Approved" instead of having it done separately. I tried some IIf statements but was not successful. Can you provide some direction?

Thank you in advance
 
Hi

Why not have a "decode" table containing two columns Status and StatusDescription

Populate it with the status values F0 .. F8 and theier descriptions, then you can include that table in your query, with a join on Status and show the "decoded" status

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
If not the above, which seems the right way, perhaps:
[tt]Status: Choose(Right([tblTable].[Status],1)+1,"Cancelled","Approved","Approved","Partially Approved")[/tt]
 
Excellent - thank you for the very quick response folks. I will try the decode table route.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top