Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> DECODE question
Having been used to Access and SQLServer, I am hitting a couple of problems translating some SQL code to Oracle. Here's one that I can't seem to work out.
Consider the following Access code. Basically, it looks at a field called RotaShift. If this is filled in, that is the field that is used, otherwise the field AltShift is used.
IIf ( RotaShift IS NULL, AltShift, RotaShift) AS Shift
Now in trying to translate this to Oracle, I have come up with :-
DECODE (RotaShift, Null, AltShift, RotaShift) AS Shift
However, this doesn't seem to work. From what I can see, the 3rd and 4th arguments can only be numeric values, not fields. Is there a workaround for this.
TIA Jason. Received on Fri Jul 06 2001 - 13:16:47 CDT
![]() |
![]() |