From ffee472954358e2f91ffd9c947f1ae9d05e5ab0c Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Tue, 25 Feb 2020 16:50:39 -0500 Subject: [PATCH] make date ranges inclusive of lsat date --- offline/addmonth_vd.sql | 2 +- route_sql/addmonth_vupd.sql | 2 +- route_sql/new_basket.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/offline/addmonth_vd.sql b/offline/addmonth_vd.sql index 9a82667..10d998a 100644 --- a/offline/addmonth_vd.sql +++ b/offline/addmonth_vd.sql @@ -67,7 +67,7 @@ target AS (select target_increment incr) ,to_char(N1FSYP,'FM0000') FSPR ,N1SD01 SDAT ,N1ED01 EDAT - ,daterange(n1sd01, n1ed01) drange + ,daterange(n1sd01, n1ed01,'[]') drange ,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 diff --git a/route_sql/addmonth_vupd.sql b/route_sql/addmonth_vupd.sql index 0bd57c5..565b1a2 100644 --- a/route_sql/addmonth_vupd.sql +++ b/route_sql/addmonth_vupd.sql @@ -63,7 +63,7 @@ target AS (select target_volume vincr, target_price pincr) ,to_char(N1FSYP,'FM0000') FSPR ,N1SD01 SDAT ,N1ED01 EDAT - ,daterange(n1sd01, n1ed01) drange + ,daterange(n1sd01, n1ed01,'[]') drange ,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 diff --git a/route_sql/new_basket.sql b/route_sql/new_basket.sql index 192c773..9aea189 100644 --- a/route_sql/new_basket.sql +++ b/route_sql/new_basket.sql @@ -13,7 +13,7 @@ target AS (select $$replace_request$$::json def) ,to_char(N1FSYP,'FM0000') FSPR ,N1SD01 SDAT ,N1ED01 EDAT - ,daterange(n1sd01, n1ed01) drange + ,daterange(n1sd01, n1ed01,'[]') drange ,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