|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
IFF Else syntax with Access DB
Hi,
Is it possible to have something like this (MS Access DB): SELECT IIF (oacabrt = 'A', 140) ELSEIFF (oacabrt = 'B', 100) ELSEIFF (oacabrt = 'C', 80) ELSEIFF (oacabrt = 'D', 60) I know I can have IFF but don't know how to intergrate the else Thanks, Sanjay |
|
#2
|
||||
|
||||
|
yes, all you need to do is nest them
SELECT IIF(oacabrt = 'A', 140, IIF(oacabrt = 'B', 100, IIF(oacabrt = 'C', 80, IIF(oacabrt = 'D', 60)))) as foo from yourtable... rudy http://r937.com/ edit: typo IFF changed to correct IIF Last edited by r937 : September 30th, 2003 at 05:05 AM. |
|
#3
|
|||
|
|||
|
Thanks, that works perfectly
BTW could you ammend your code from IFF to IIF just in case someone else needs it Thanks, Sanjay |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > IFF Else syntax with Access DB |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|