This commit is contained in:
Paul Trowbridge 2018-05-29 23:14:41 -04:00
parent baadaaef8d
commit 0301883d49
3 changed files with 23 additions and 2 deletions

View File

@ -1 +1,14 @@
copy (select r.* from tps.trans join lateral jsonb_populate_record(null::tps.dcard, rec) r on true where srce = 'DCARD') to 'C:\users\fleet\downloads\dcard.csv' with (format csv, header true); copy (
select
to_char(r."Trans. Date",'mm/dd/yyyy') "Trans. Date"
,to_char(r."Post Date",'mm/dd/yyyy') "Post Date"
,r."Description"
,r."Amount"
,r."Category"
from
tps.trans
join lateral jsonb_populate_record(null::tps.dcard, rec) r on true
where
srce = 'DCARD'
) to
'C:\users\fleet\downloads\dcard.csv' with (format csv, header true);

8
reports/dcard_bal.sql Normal file
View File

@ -0,0 +1,8 @@
\timing
SELECT
r.*
,SUM(r."Amount") OVER (ORDER BY r."Post Date" asc , r."Description") + 1061.1 + 22.40 balance
FROM
tpsv.dcard_default r
ORDER BY
r."Post Date" asc

View File

@ -1 +1 @@
curl -v -F upload=@//mnt/c/Users/fleet/Downloads/dcard.csv http://localhost:81/import?srce=dcard curl -v -F upload=@//mnt/c/Users/fleet/Downloads/DFS-Search-20180529.csv http://localhost:81/import?srce=dcard