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