i.am.sophie
Registered User.
- Local time
- Today, 22:17
- Joined
- May 29, 2015
- Messages
- 14
[SOLVED] Combine nested IIF and SELECT TOP
Hi All,
I'm working on a database which shows the performance of our field colleagues.
I'm done with almost all functions, except for one.
I have a search form where the user will be able to search colleagues based on different criteria. One of this goes like this:
Show me the top..
5%
10%
15%
and an option button next to each.
I need a query something like this:
IIF [Top5]=True, SELECT TOP 5 PERCENT ColA, ColB, ColC
ELSE
IIF [Top10]=True, SELECT TOP 10 PERCENT ColA, ColB, ColC
ELSE
IIF [Top15]=True, SELECT TOP 15 PERCENT ColA, ColB, ColC
FROM Table1
ORDER BY Score DESC
Can someone please help?
Thanks
Hi All,
I'm working on a database which shows the performance of our field colleagues.
I'm done with almost all functions, except for one.
I have a search form where the user will be able to search colleagues based on different criteria. One of this goes like this:
Show me the top..
5%
10%
15%
and an option button next to each.
I need a query something like this:
IIF [Top5]=True, SELECT TOP 5 PERCENT ColA, ColB, ColC
ELSE
IIF [Top10]=True, SELECT TOP 10 PERCENT ColA, ColB, ColC
ELSE
IIF [Top15]=True, SELECT TOP 15 PERCENT ColA, ColB, ColC
FROM Table1
ORDER BY Score DESC
Can someone please help?
Thanks
Last edited: