diff --git a/reload/dump.sql b/reload/dump.sql index 269b550..f6e24b2 100644 --- a/reload/dump.sql +++ b/reload/dump.sql @@ -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); \ No newline at end of file +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); \ No newline at end of file diff --git a/reports/dcard_bal.sql b/reports/dcard_bal.sql new file mode 100644 index 0000000..0eb89d4 --- /dev/null +++ b/reports/dcard_bal.sql @@ -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 \ No newline at end of file diff --git a/sample_discovercard/curl_import.cmd b/sample_discovercard/curl_import.cmd index 1ce2522..0c0f76b 100644 --- a/sample_discovercard/curl_import.cmd +++ b/sample_discovercard/curl_import.cmd @@ -1 +1 @@ -curl -v -F upload=@//mnt/c/Users/fleet/Downloads/dcard.csv http://localhost:81/import?srce=dcard \ No newline at end of file +curl -v -F upload=@//mnt/c/Users/fleet/Downloads/DFS-Search-20180529.csv http://localhost:81/import?srce=dcard \ No newline at end of file