make date ranges inclusive of lsat date

This commit is contained in:
Paul Trowbridge 2020-02-25 16:50:39 -05:00
parent e05efeb1e2
commit ffee472954
3 changed files with 3 additions and 3 deletions

View File

@ -67,7 +67,7 @@ target AS (select target_increment incr)
,to_char(N1FSYP,'FM0000') FSPR ,to_char(N1FSYP,'FM0000') FSPR
,N1SD01 SDAT ,N1SD01 SDAT
,N1ED01 EDAT ,N1ED01 EDAT
,daterange(n1sd01, n1ed01) drange ,daterange(n1sd01, n1ed01,'[]') drange
,to_char(N1ED01,'yymm') CAPR ,to_char(N1ED01,'yymm') CAPR
,N1ED01 - N1SD01 +1 NDAYS ,N1ED01 - N1SD01 +1 NDAYS
,CASE WHEN EXTRACT(MONTH FROM N1ED01) >= 6 THEN EXTRACT(YEAR FROM N1ED01) + 1 ELSE EXTRACT(YEAR FROM N1ED01) END SSYR ,CASE WHEN EXTRACT(MONTH FROM N1ED01) >= 6 THEN EXTRACT(YEAR FROM N1ED01) + 1 ELSE EXTRACT(YEAR FROM N1ED01) END SSYR

View File

@ -63,7 +63,7 @@ target AS (select target_volume vincr, target_price pincr)
,to_char(N1FSYP,'FM0000') FSPR ,to_char(N1FSYP,'FM0000') FSPR
,N1SD01 SDAT ,N1SD01 SDAT
,N1ED01 EDAT ,N1ED01 EDAT
,daterange(n1sd01, n1ed01) drange ,daterange(n1sd01, n1ed01,'[]') drange
,to_char(N1ED01,'yymm') CAPR ,to_char(N1ED01,'yymm') CAPR
,N1ED01 - N1SD01 +1 NDAYS ,N1ED01 - N1SD01 +1 NDAYS
,CASE WHEN EXTRACT(MONTH FROM N1ED01) >= 6 THEN EXTRACT(YEAR FROM N1ED01) + 1 ELSE EXTRACT(YEAR FROM N1ED01) END SSYR ,CASE WHEN EXTRACT(MONTH FROM N1ED01) >= 6 THEN EXTRACT(YEAR FROM N1ED01) + 1 ELSE EXTRACT(YEAR FROM N1ED01) END SSYR

View File

@ -13,7 +13,7 @@ target AS (select $$replace_request$$::json def)
,to_char(N1FSYP,'FM0000') FSPR ,to_char(N1FSYP,'FM0000') FSPR
,N1SD01 SDAT ,N1SD01 SDAT
,N1ED01 EDAT ,N1ED01 EDAT
,daterange(n1sd01, n1ed01) drange ,daterange(n1sd01, n1ed01,'[]') drange
,to_char(N1ED01,'yymm') CAPR ,to_char(N1ED01,'yymm') CAPR
,N1ED01 - N1SD01 +1 NDAYS ,N1ED01 - N1SD01 +1 NDAYS
,CASE WHEN EXTRACT(MONTH FROM N1ED01) >= 6 THEN EXTRACT(YEAR FROM N1ED01) + 1 ELSE EXTRACT(YEAR FROM N1ED01) END SSYR ,CASE WHEN EXTRACT(MONTH FROM N1ED01) >= 6 THEN EXTRACT(YEAR FROM N1ED01) + 1 ELSE EXTRACT(YEAR FROM N1ED01) END SSYR