From c56f59045a43b075c6b6e23023b7a4d7a351bde2 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 28 Aug 2024 12:50:42 -0400 Subject: [PATCH] chase balance --- database/reports/chase_bal.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 database/reports/chase_bal.sql diff --git a/database/reports/chase_bal.sql b/database/reports/chase_bal.sql new file mode 100644 index 0000000..99efd46 --- /dev/null +++ b/database/reports/chase_bal.sql @@ -0,0 +1,14 @@ +\timing +SELECT + r.id + ,r.logid + ,r."Type" + ,r."Trans Date" + ,r."Post Date" + ,r."Description" + ,-r."Amount" "Amount" + ,SUM(-r."Amount") OVER (ORDER BY r."Post Date" asc , r.id) + 374.23 balance +FROM + tpsv.chase_default r +ORDER BY + r."Post Date" desc