HomeQuery LibraryQuickBooks

Which customers owe you money — and how overdue are they?

Accounts receivable aging is a critical cash flow signal. This query finds every overdue invoice in QuickBooks, ranked by amount outstanding and days past due.

📊 QuickBooks Online👥 Finance and accounts receivable teams🔤 Plain-English → SQL
Show me all overdue invoices by customer with amount owed and days past due
QuickBooks Overdue Invoices by Customer — generated by Taptic Data AI
SELECT
  c.display_name                                         AS customer,
  c.primary_email_addr                                   AS email,
  COUNT(i.id)                                           AS overdue_invoices,
  ROUND(SUM(i.balance)::numeric, 2)                    AS total_owed,
  MAX(CURRENT_DATE - i.due_date::date)                 AS max_days_overdue,
  MIN(i.due_date::date)                                AS oldest_due_date,
  ROUND(AVG(i.balance)::numeric, 2)                    AS avg_invoice_balance
FROM qbo_invoices i
JOIN qbo_customers c ON c.id = i.customer_id
WHERE i.balance > 0
  AND i.due_date::date < CURRENT_DATE
  AND i.transaction_status NOT IN ('Void', 'Deleted')
GROUP BY c.id, c.display_name, c.primary_email_addr
ORDER BY total_owed DESC
Schema-aware SQL generated from plain English15 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. This type of analysis is commonly used in quickbooks financial reporting.

Breaking it down line by line

  1. Filters to invoices with a positive balance (unpaid) and a due date before today
  2. Excludes voided and deleted transactions that would distort the AR balance
  3. MAX(days overdue) shows the worst-case aging per customer
  4. MIN(due_date) reveals the oldest unpaid invoice — useful for prioritizing follow-up
  5. Results ordered by total amount owed descending so the highest-value collection targets appear first

Result description

Every customer with at least one overdue invoice, showing total amount owed, number of overdue invoices, maximum days overdue, and oldest due date.

The business impact

Overdue receivables directly affect cash flow. A customer owing $40,000 that is 90 days past due is a very different risk profile than one 5 days late on $500. This query surfaces both dimensions so your finance team can prioritize collection efforts.

All queries and use cases on this page relate to analyzing your QuickBooks Online data in Taptic. To see the full analytics workflow, explore quickbooks financial reporting.

Common questions

How do I generate a "QuickBooks Overdue Invoices by Customer" query automatically?
In Taptic Data, type "Show me all overdue invoices by customer with amount owed and 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 all overdue invoices by customer with amount owed an..." 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.