Re: IIF statement in query
- From: "Graham R Seach" <gseach@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 8 Sep 2006 00:27:22 +1000
Ahh, the simplest methods are always the best! :-)
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
"Duane Hookom" <DuaneAtNoSpanHookomDotNet> wrote in message
news:e6Hu5ho0GHA.4796@xxxxxxxxxxxxxxxxxxxxxxx
Or don't use an expression at all. Create a small lookup table
tblPriorities
=============================
Band
Priority
With values like
1 Very Low Priority
2 Low Priority
...
You can add this table to your query and join the band fields.
--
Duane Hookom
MS Access MVP
"Graham R Seach" <gseach@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:ummL0Zo0GHA.4648@xxxxxxxxxxxxxxxxxxxxxxx
SELECT band, IIf(band=1,"Very Low Priority", IIF(band=2,"Low Priority",
IIF(band=3,"Medium Priority", IIF(band=4,"High Priority","Very High
Priority")))) As Priority FROM Table1
...or...
SELECT band, Choose(band,"Very Low Priority", "Low Priority", "Medium
Priority", "High Priority","Very High Priority") As Priority FROM Table1
...or...
SELECT band, Switch(band=1,"Very Low Priority", band=2,"Low Priority",
band=3,"Medium Priority", band=4,"High Priority",band=5,"Very High
Priority") As Priority FROM Table1
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
<cdolphin88@xxxxxxxxxxx> wrote in message
news:1157636779.130732.138620@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello,
I have the query below that I used an IIF statement to classified the
different band..
Is that possible to show me in only one column the different
classification? Because now it shows in 5 different column..
the query I'm using is like this:
SELECT band, IIF(band = 1, 'Very Low Priority'), IIF(band = 2, 'Low
Priority'), IIF(band = 3, 'Medium Priority'), IIF(band = 4, 'High
Priority'), IIF(band = 5, 'Very High Priority')
FROM Table1;
Cheers
.
- References:
- IIF statement in query
- From: cdolphin88
- Re: IIF statement in query
- From: Graham R Seach
- Re: IIF statement in query
- From: Duane Hookom
- IIF statement in query
- Prev by Date: Re: update query: still having problems
- Next by Date: Re: How to use "if" statements in a query or function?
- Previous by thread: Re: IIF statement in query
- Next by thread: Allowing multiple Criteria in a Make Table macro
- Index(es):
Relevant Pages
|