Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to change a case to decode

562377Feb 28 2007 — edited Feb 28 2007
how 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'
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 28 2007
Added on Feb 28 2007
11 comments
830 views