Fix between call being inclusive

This commit is contained in:
Jan Bader 2021-12-07 20:28:48 +00:00
parent 64822912d9
commit 8c9c78a789
2 changed files with 4 additions and 4 deletions

View File

@ -135,7 +135,7 @@ SELECT categories.id, categories.name, category_groups.name as group,
SELECT SUM(t_this.amount) SELECT SUM(t_this.amount)
FROM transactions t_this FROM transactions t_this
WHERE categories.id = t_this.category_id WHERE categories.id = t_this.category_id
AND t_this.date BETWEEN $1 AND $2 AND t_this.date >= $1 AND t_this.date < $2
) )
, 0)::decimal(12,2) as activity, , 0)::decimal(12,2) as activity,
COALESCE( COALESCE(
@ -143,7 +143,7 @@ SELECT categories.id, categories.name, category_groups.name as group,
SELECT SUM(a_hist.amount) SELECT SUM(a_hist.amount)
FROM assignments a_hist FROM assignments a_hist
WHERE categories.id = a_hist.category_id WHERE categories.id = a_hist.category_id
AND a_hist.date BETWEEN $1 AND $2 AND a_hist.date >= $1 AND a_hist.date < $2
) )
,0)::decimal(12,2) as assigned ,0)::decimal(12,2) as assigned

View File

@ -41,7 +41,7 @@ SELECT categories.id, categories.name, category_groups.name as group,
SELECT SUM(t_this.amount) SELECT SUM(t_this.amount)
FROM transactions t_this FROM transactions t_this
WHERE categories.id = t_this.category_id WHERE categories.id = t_this.category_id
AND t_this.date BETWEEN @from_date AND @to_date AND t_this.date >= @from_date AND t_this.date < @to_date
) )
, 0)::decimal(12,2) as activity, , 0)::decimal(12,2) as activity,
COALESCE( COALESCE(
@ -49,7 +49,7 @@ SELECT categories.id, categories.name, category_groups.name as group,
SELECT SUM(a_hist.amount) SELECT SUM(a_hist.amount)
FROM assignments a_hist FROM assignments a_hist
WHERE categories.id = a_hist.category_id WHERE categories.id = a_hist.category_id
AND a_hist.date BETWEEN @from_date AND @to_date AND a_hist.date >= @from_date AND a_hist.date < @to_date
) )
,0)::decimal(12,2) as assigned ,0)::decimal(12,2) as assigned