From ff3e18edc743ae1e49824e890e751679370f8a6d Mon Sep 17 00:00:00 2001 From: pt Date: Sun, 16 Feb 2020 22:23:38 -0500 Subject: [PATCH] add sort to month name --- route_sql/addmonth_vupd.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/route_sql/addmonth_vupd.sql b/route_sql/addmonth_vupd.sql index 1ab28c4..d593b01 100644 --- a/route_sql/addmonth_vupd.sql +++ b/route_sql/addmonth_vupd.sql @@ -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