Hello,
I am attempting to group transactions by month. However we are on a fiscal year with October being Period 1. I'm a beginner when it comes to Oracle so please bear with me.
I'm using the following code, which groups and handles the months correctly, making OCT period 01. However it is taking the YEAR component as the calendar year value. I need to modify statement that if Month is Oct - Dec, then add 1 to the YEAR. Else use the YEAR out of the actual_finish_date value:
"to_number(to_char(wot.actual_finish_date,'YYYY')||decode(to_char(wot.actual_finish_date,'MON'),
'OCT','01','NOV','02','DEC','03','JAN','04',
'FEB','05','MAR','06','APR','07','MAY','08',
'JUN','09','JUL','10','AUG','11','SEP','12'))Actual_Finish_Period"
My results of this are not correct -- Actual_Finish_Period for OCT - DEC should read 200601,200602, 200603 not 200501, etc:
Actual_Finish_Date Actual_Finish_Period
20051011 200501
20051118 200502
20051230 200503
20060115 200604
I've tried adding 1 to YEAR as but that did't work:
"to_number(to_char(wot.actual_finish_date + 1,'YYYY')||decode(to_char(wot.actual_finish_date,'MON'),
'OCT','01'.........
Thank you!!
I am attempting to group transactions by month. However we are on a fiscal year with October being Period 1. I'm a beginner when it comes to Oracle so please bear with me.
I'm using the following code, which groups and handles the months correctly, making OCT period 01. However it is taking the YEAR component as the calendar year value. I need to modify statement that if Month is Oct - Dec, then add 1 to the YEAR. Else use the YEAR out of the actual_finish_date value:
"to_number(to_char(wot.actual_finish_date,'YYYY')||decode(to_char(wot.actual_finish_date,'MON'),
'OCT','01','NOV','02','DEC','03','JAN','04',
'FEB','05','MAR','06','APR','07','MAY','08',
'JUN','09','JUL','10','AUG','11','SEP','12'))Actual_Finish_Period"
My results of this are not correct -- Actual_Finish_Period for OCT - DEC should read 200601,200602, 200603 not 200501, etc:
Actual_Finish_Date Actual_Finish_Period
20051011 200501
20051118 200502
20051230 200503
20060115 200604
I've tried adding 1 to YEAR as but that did't work:
"to_number(to_char(wot.actual_finish_date + 1,'YYYY')||decode(to_char(wot.actual_finish_date,'MON'),
'OCT','01'.........
Thank you!!