add sort to month name

This commit is contained in:
pt 2020-02-16 22:23:38 -05:00
parent 53ac7f90e2
commit ff3e18edc7

View File

@ -67,7 +67,7 @@ target AS (select target_volume vincr, target_price pincr)
,to_char(N1ED01,'yymm') CAPR
,N1ED01 - N1SD01 +1 NDAYS
,CASE WHEN EXTRACT(MONTH FROM N1ED01) >= 6 THEN EXTRACT(YEAR FROM N1ED01) + 1 ELSE EXTRACT(YEAR FROM N1ED01) END SSYR
,to_char(CASE WHEN EXTRACT(MONTH FROM N1ED01) >= 6 THEN EXTRACT(MONTH FROM N1ED01) -5 ELSE EXTRACT(MONTH FROM N1ED01) +7 END,'00') SSPR
,to_char(CASE WHEN EXTRACT(MONTH FROM N1ED01) >= 6 THEN EXTRACT(MONTH FROM N1ED01) -5 ELSE EXTRACT(MONTH FROM N1ED01) +7 END,'FM00') SSPR
FROM
LGDAT.GLDATREF
INNER JOIN LGDAT.GLDATE ON
@ -321,13 +321,13 @@ SELECT
,b.calc_status
,b.flag
,make_date(mseq.yr + 2021,mseq.cal,m.odom) order_date
,to_char(make_date(mseq.yr + 2021,mseq.cal,m.odom),'Mon') order_month
,od.sspr || ' - ' || to_char(make_date(mseq.yr + 2021,mseq.cal,m.odom),'Mon') order_month
,od.ssyr order_season
,make_date(mseq.yr + 2021,mseq.cal,m.odom) + rlag request_date
,to_char(make_date(mseq.yr + 2021,mseq.cal,m.odom) + rlag,'Mon') request_month
,rd.sspr || ' - ' ||to_char(make_date(mseq.yr + 2021,mseq.cal,m.odom) + rlag,'Mon') request_month
,rd.ssyr request_season
,make_date(mseq.yr + 2021,mseq.cal,m.odom) + rlag + slag ship_date
,to_char(make_date(mseq.yr + 2021,mseq.cal,m.odom) + rlag + slag,'Mon') ship_month
,sd.sspr || ' - ' || to_char(make_date(mseq.yr + 2021,mseq.cal,m.odom) + rlag + slag,'Mon') ship_month
,sd.ssyr ship_season
,'replace_version' "version"
,'replace_source'||' volume' iter