From 60d30b8c92e25338d04b6e82d020b9dcf9c83da8 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 29 Aug 2024 14:06:05 -0400 Subject: [PATCH] balances --- database/reports/stacked.sql | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/database/reports/stacked.sql b/database/reports/stacked.sql index a1240c8..f85deeb 100644 --- a/database/reports/stacked.sql +++ b/database/reports/stacked.sql @@ -68,12 +68,16 @@ SELECT ,s.pdate ,s.descr ,s.amount - ,s.category + --,s.category ,s.party ,s.reason - ,s.balance + --,s.balance + ,CASE WHEN s.srce = 'hunt' THEN s.balance ELSE null END hunt + ,CASE WHEN s.srce = 'dcard' THEN s.balance ELSE null END dcard + ,CASE WHEN s.srce = 'chase' THEN s.balance ELSE null END chase ,sum(s.amount) over (ORDER BY s.pdate asc, s.id) + 28452.02 netbalance FROM stacked s ORDER BY s.pdate desc + ,s.id desc