select
when arriveDT > appointmentDT then "OT"
when arriveDT <= appointmentDT then "Normal"
else "unknown"
from contract
thanks
vchu
--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums.aspx/informix/200804/1
select
case
when arriveDT > appointmentDT then "OT"
when arriveDT <= appointmentDT then "Normal"
else "unknown"
end
from contract;
Art S. Kagel
Oninit
Art S. Kagel (Oninit) wrote:
>> Can someone help me to convert something like this in Informix SQL?
>>
>[quoted text clipped - 6 lines]
>> thanks
>> vchu
>Not so different:
>
>select
> case
> when arriveDT > appointmentDT then "OT"
> when arriveDT <= appointmentDT then "Normal"
> else "unknown"
> end
>from contract;
>
>Art S. Kagel
>Oninit
--
Message posted via http://www.dbmonster.com
Just a tiny note: if you're parsing your output, or want to put it
into a temp table, you'll need to specify a name for the returned
value (Informix will just return "(expression)" as the identifier.
Just add your preferred identifier to the 'end' statement, e.g.
select
case
<stuff>
end arriveDT_status
from contract
(or whatever you want to call it).
Malc