File size: 364 Bytes
27ec678
 
 
1
2
3
4
-- Amount invoiced, by currency
-- Totals of invoices not voided, by the month made, in each currency's major units.
SELECT strftime(created, '%Y-%m') AS month, upper(currency) AS grp, sum((total) / 100.0) AS value FROM billing.invoice WHERE created >= TIMESTAMP '2023-10-01' AND created < TIMESTAMP '2026-10-01' AND (status <> 'void') GROUP BY 1, 2 ORDER BY 1, 2