From e7ce48405b75035cfd0180586bb0abd60876bd28 Mon Sep 17 00:00:00 2001 From: pt Date: Sat, 15 Feb 2020 03:26:04 -0500 Subject: [PATCH] increment year --- route_sql/addmonth_vupd.sql | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/route_sql/addmonth_vupd.sql b/route_sql/addmonth_vupd.sql index 14110ff..1ab28c4 100644 --- a/route_sql/addmonth_vupd.sql +++ b/route_sql/addmonth_vupd.sql @@ -320,14 +320,14 @@ SELECT ,b.cost_usd*s.factor*m.momix cost_usd ,b.calc_status ,b.flag - ,make_date(mseq.yr + 2020,mseq.cal,m.odom) order_date - ,to_char(make_date(mseq.yr + 2020,mseq.cal,m.odom),'Mon') order_month + ,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.ssyr order_season - ,make_date(mseq.yr + 2020,mseq.cal,m.odom) + rlag request_date - ,to_char(make_date(mseq.yr + 2020,mseq.cal,m.odom) + rlag,'Mon') request_month + ,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.ssyr request_season - ,make_date(mseq.yr + 2020,mseq.cal,m.odom) + rlag + slag ship_date - ,to_char(make_date(mseq.yr + 2020,mseq.cal,m.odom) + rlag + slag,'Mon') ship_month + ,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.ssyr ship_season ,'replace_version' "version" ,'replace_source'||' volume' iter @@ -343,11 +343,11 @@ FROM LEFT OUTER JOIN mseq ON mseq.m = closest.m LEFT OUTER JOIN gld od ON - make_date(mseq.yr + 2020,mseq.cal,m.odom) BETWEEN od.sdat AND od.edat + make_date(mseq.yr + 2021,mseq.cal,m.odom) BETWEEN od.sdat AND od.edat LEFT OUTER JOIN gld rd ON - make_date(mseq.yr + 2020,mseq.cal,m.odom) + rlag BETWEEN rd.sdat AND rd.edat + make_date(mseq.yr + 2021,mseq.cal,m.odom) + rlag BETWEEN rd.sdat AND rd.edat LEFT OUTER JOIN gld sd ON - make_date(mseq.yr + 2020,mseq.cal,m.odom) + rlag + slag BETWEEN sd.sdat AND sd.edat + make_date(mseq.yr + 2021,mseq.cal,m.odom) + rlag + slag BETWEEN sd.sdat AND sd.edat WHERE m._month = (SELECT _month FROM closest) )