HomeQuery LibraryQuickBooks

Which vendors are you late paying — and by how much?

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.

📊 QuickBooks Online👥 Finance and accounts payable teams🔤 Plain-English → SQL

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.

Show me accounts payable aging by vendor — outstanding bills with days past due
QuickBooks Accounts Payable Aging by Vendor — generated by Taptic Data AI
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
Schema-aware SQL generated from plain English17 lines

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.

Breaking it down line by line

  1. Filters to bills with a positive balance and a due date before today — only overdue bills
  2. CASE statements bucket the outstanding amounts into standard aging periods: 0-30, 31-60, 61-90, 90+ days
  3. MAX(days overdue) identifies your most delinquent bill per vendor
  4. MIN(due_date) reveals the oldest unpaid bill — often the one that needs immediate action
  5. Results ranked by total owed descending for quick triage

Result description

Per-vendor accounts payable aging with total owed, aging buckets, maximum days overdue, and oldest due date.

The business impact

Late vendor payments damage relationships and can trigger unfavorable credit terms. Paying 90 days late to a critical supplier while sitting on cash for a vendor you rarely use is a prioritization failure. AP aging by vendor gives your finance team a clear action list.

Common questions

How do I generate a "QuickBooks Accounts Payable Aging by Vendor" query automatically?
In Taptic Data, type "Show me accounts payable aging by vendor — outstanding bills with days past due" and the AI generates schema-aware SQL against your real QuickBooks Online data — no manual writing required.
What database does this query work with?
This query is designed for QuickBooks Online. Taptic reads your live schema so the generated SQL always matches your actual table and column names.
Can I edit the generated SQL?
Yes. Taptic shows you the exact SQL it generated. You can edit it directly, ask the AI to explain any line, or request a revision in plain English.
Can I save this as a scheduled report?
Yes. Once you run this query in Taptic, you can save it as a report, add charts and KPIs, and schedule it to email your team on any cadence — daily, weekly, or monthly.

Skip the SQL. Ask the question.

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/mo

No credit card required. Connect your data source in under 5 minutes.