From c0e348bb2f75fbab7a191afd2e1fff0d5e1cd69d Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Tue, 5 May 2020 16:52:53 -0400 Subject: [PATCH] increment range for actuals --- build/merge_actuals_exec.sql | 5 +---- build/merge_actuals_pool.sql | 4 ++-- build/merge_actuals_prep.sql | 3 ++- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/build/merge_actuals_exec.sql b/build/merge_actuals_exec.sql index 179177d..852c99b 100644 --- a/build/merge_actuals_exec.sql +++ b/build/merge_actuals_exec.sql @@ -1,6 +1,3 @@ DELETE FROM rlarp.osmf_dev WHERE odate < '2020-05-01'; -INSERT INTO rlarp.osmf_dev SELECT * FROM rlarp.osmfs_dev WHERE odate < '2020-05-01'; - - - +INSERT INTO rlarp.osmf_dev SELECT * FROM rlarp.osmfs_dev WHERE odate < '2020-05-01'; \ No newline at end of file diff --git a/build/merge_actuals_pool.sql b/build/merge_actuals_pool.sql index d3034e6..369f2be 100644 --- a/build/merge_actuals_pool.sql +++ b/build/merge_actuals_pool.sql @@ -1,6 +1,6 @@ BEGIN; -DELETE FROM rlarp.osm_pool WHERE order_date < '2020-04-01'; +DELETE FROM rlarp.osm_pool WHERE order_date < '2020-05-01'; INSERT INTO rlarp.osm_pool WITH @@ -134,7 +134,7 @@ FROM LEFT OUTER JOIN rlarp.itemm i ON i.item = o.part WHERE - odate < '2020-04-01'; + odate < '2020-05-01'; SELECT diff --git a/build/merge_actuals_prep.sql b/build/merge_actuals_prep.sql index d70e25e..513d845 100644 --- a/build/merge_actuals_prep.sql +++ b/build/merge_actuals_prep.sql @@ -149,11 +149,12 @@ gld AS ( --...or any open orders currently booked before cutoff.... OR (o.calc_status IN ('OPEN','BACKORDER') and o.odate < '2020-05-01') --...or anything that shipped in that period - OR o.fspr BETWEEN '2001' AND '2010' + OR o.fspr BETWEEN '2001' AND '2011' ) AND fs_line = '41010' AND calc_status <> 'CANCELED' AND NOT (calc_status = 'CLOSED' AND flag = 'REMAINDER') + AND "version" = 'ACTUALS' GROUP BY o.fspr ,plnt