how to change a case to decode
562377Feb 28 2007 — edited Feb 28 2007how will u convert this case statement into a decode statement
please help
case when to_char(sysdate,'DD-MON-YYYY') - onhand.t_date< 30 then SUM (moh.transaction_quantity) end as '30days',
case when to_char(sysdate,'DD-MON-YYYY') - onhand.t_date >= 30 and to_char(sysdate,'DD-MON-YYYY') - onhand.t_date < 60 then SUM (moh.transaction_quantity) end as '30 TO 60 DAYS',
case when to_char(sysdate,'DD-MON-YYYY') - onhand.t_date >= 60 and to_char(sysdate,'DD-MON-YYYY') - onhand.t_date < 90 then SUM (moh.transaction_quantity) end as '60 TO 90 DAYS' ,
case when to_char(sysdate,'DD-MON-YYYY') - onhand.t_date >= 90 and to_char(sysdate,'DD-MON-YYYY') - onhand.t_date < 180 then SUM (moh.transaction_quantity) end as '90 TO 180 DAYS',
case when to_char(sysdate,'DD-MON-YYYY') - onhand.t_date >= 180 then SUM (moh.transaction_quantity) end as '180 DAYS'