From 18020e8451918537527f16b248c89e4fe1892b07 Mon Sep 17 00:00:00 2001 From: Mohammed Sohail Date: Fri, 26 Aug 2022 07:59:14 +0000 Subject: [PATCH] fix: sql cmr queries --- queries/dashboard.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/queries/dashboard.sql b/queries/dashboard.sql index 8fba96b..550d891 100644 --- a/queries/dashboard.sql +++ b/queries/dashboard.sql @@ -17,7 +17,7 @@ LIMIT 730; -- This query generates a date range and left joins the users table to include days with no registrations -- Produces x, y results for displaying on a line chart WITH date_range AS ( - SELECT day::date FROM generate_series('08-01-2022', '08-26-2022', INTERVAL '1 day') day + SELECT day::date FROM generate_series($1, $2, INTERVAL '1 day') day ) SELECT date_range.day AS x, COUNT(users.id) AS y @@ -47,12 +47,12 @@ GROUP BY date_range.day ORDER BY date_range.day LIMIT 730; --- name: transaction-count-cmr +-- name: transactions-count-cmr -- This is a patch to support CMR dashboard -- This query generates a date range and left joins the transactions table to include days with no transactions -- Produces x, y results for displaying on a line chart WITH date_range AS ( - SELECT day::date FROM generate_series('08-01-2022', '08-26-2022', INTERVAL '1 day') day + SELECT day::date FROM generate_series($1, $2, INTERVAL '1 day') day ), exclude AS ( SELECT sys_address FROM sys_accounts WHERE sys_address IS NOT NULL