Hello,
I am used to using case within my select statements, I need to use decode if possible for this one. Its for a record group within in forms, and the case statement is not working. Could someone please help me write this with decode instead of case?
SELECT CASE
WHEN months_between(sysdate , c.birth_dt) BETWEEN 168 AND 216 THEN 1 --14 to 18
WHEN months_between(sysdate , c.birth_dt) BETWEEN 217 AND 252 THEN 2 --18 to 21
WHEN months_between(sysdate , c.birth_dt) BETWEEN 253 AND 780 THEN 3 --21 to 65
WHEN months_between(sysdate , c.birth_dt) > 780 then 4 --older than 65
ELSE NULL END
FROM mw_clients c
Thanks in advance!
Jim P.