Accounts payable aging is the mirror image of AR aging. This query shows your outstanding bills by vendor, ranked by amount owed and days past due, so your finance team can prioritize payments and protect vendor relationships.
This is part of the Taptic Data QuickBooks query library. Explore related queries: SQL query for QuickBooks net income by month and SQL query for QuickBooks overdue invoices by customer.
The question
The SQL Taptic generates
SELECT v.display_name AS vendor, COUNT(b.id) AS open_bills, ROUND(SUM(b.balance)::numeric, 2) AS total_owed, MAX(CURRENT_DATE - b.due_date::date) AS max_days_overdue, MIN(b.due_date::date) AS oldest_due_date, ROUND(AVG(b.balance)::numeric, 2) AS avg_bill_balance, SUM(CASE WHEN CURRENT_DATE - b.due_date::date <= 30 THEN b.balance ELSE 0 END)::numeric AS overdue_0_30, SUM(CASE WHEN CURRENT_DATE - b.due_date::date BETWEEN 31 AND 60 THEN b.balance ELSE 0 END)::numeric AS overdue_31_60, SUM(CASE WHEN CURRENT_DATE - b.due_date::date BETWEEN 61 AND 90 THEN b.balance ELSE 0 END)::numeric AS overdue_61_90, SUM(CASE WHEN CURRENT_DATE - b.due_date::date > 90 THEN b.balance ELSE 0 END)::numeric AS overdue_90_plus FROM qbo_bills b JOIN qbo_vendors v ON v.id = b.vendor_id WHERE b.balance > 0 AND b.due_date::date < CURRENT_DATE GROUP BY v.id, v.display_name ORDER BY total_owed DESC
This query was generated by Taptic Data from plain English against a real QuickBooks Online schema. In Taptic, you type the question — the AI writes the SQL, runs it, and returns the result. You can edit the SQL, ask for explanations, and save it as a refreshable report.
How this query works
What it returns
Per-vendor accounts payable aging with total owed, aging buckets, maximum days overdue, and oldest due date.
Why it matters
FAQ
Generate this automatically
In Taptic Data, you type "Show me accounts payable aging by vendor — outstanding bills..." and this SQL runs automatically against your real QuickBooks Online data.
Try Taptic Free — $29.99/moNo credit card required. Connect your data source in under 5 minutes.
Compare tools