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!

Change Quarters to Months

592960Jul 29 2009 — edited Aug 4 2009
Hello all,

Alright so I'm trying to change the quarters, to a set of twelve months.

I have data that looks like...

Date--------col2------col3---amount

2009Q1------22------33------100
2009Q2------55------66------200
...

I'm doing a substr and case to turn 2009Q1 into JAN-09 and so on for the other quarters. What I need to do is also create rows for the other months in the quarter, not just the first one.
So, using the example above, I need the data to look like this...

Date--------col2------col3---amount

JAN-09------22------33------100
FEB-09------22------33------0
MAR-09------22------33------0
APR-09------55------66------200
MAY-09------55------66------0
JUN-09------55------66------0
...


Q1 has been transformed into Jan/Feb/Mar and the amount only stays in the first month. The following 2 months should get a 0 for the amount.


Any help is appreciated!

Thanks

-Chris
This post has been answered by 513949 on Aug 3 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 1 2009
Added on Jul 29 2009
41 comments
2,858 views