opendentalsupport.com is an independent community resource. We are NOT affiliated with, endorsed by, or sponsored by Open Dental Software, Inc. Open Dental® is a registered trademark of Open Dental Software, Inc.

Open Dental Unearned Income Query

SQL Queries3 min read4/9/2026

If you are struggling to reconcile your patient prepayments or need a clear list of funds sitting in your system that haven't been applied to procedures, this report is for you. This open dental unearned income query provides a clean, exportable list of all unearned income currently held in your database.

The Query

Copy and paste the following code into your User Query window. This query filters for active patients and calculates the remaining unearned balance for each entry.

SET @FromDate = '2026-01-01';
SET @ToDate = '2026-12-31';

SELECT 
    p.LName, 
    p.FName, 
    ps.DatePay, 
    ps.SplitAmt AS OriginalAmount,
    ps.UnearnedType,
    (SELECT SUM(ps2.SplitAmt) 
     FROM paysplit ps2 
     WHERE ps2.PayNum = ps.PayNum 
     AND ps2.ProcNum = 0) AS RemainingUnearned
FROM paysplit ps
INNER JOIN patient p ON ps.PatNum = p.PatNum
WHERE ps.ProcNum = 0
AND ps.DatePay BETWEEN @FromDate AND @ToDate
AND p.PatStatus = 0
ORDER BY ps.DatePay;

How to Run This Query

  1. In Open Dental, go to Reports in the Main Menu.
  2. Click User Query.
  3. Paste the query provided above into the large text box.
  4. Click Submit Query.
  5. The results will display in the grid below. You can click Export to save the data as a CSV file for Excel.

Understanding the Results

How to Customize

You can easily adjust the parameters of this report to fit your needs:

Variations

If you want to see only prepayments that are older than 90 days to help with your accounting cleanup, you can add a filter to the WHERE clause:

AND ps.DatePay < DATE_SUB(CURDATE(), INTERVAL 90 DAY)

Skip the Query — Use DentalCanvas Instead

Don't want to write SQL? DentalCanvas connects to your Open Dental database and shows you this data automatically in a visual dashboard — no queries required.


This article is provided by opendentalsupport.com, an independent community resource. We are not affiliated with Open Dental Software, Inc.

Stop Writing SQL.

DentalCanvas connects directly to your Open Dental database and shows you production, collections, scheduling, and more — in a visual dashboard you can understand at a glance. No queries. No exports. Just answers.

Try DentalCanvas

Was this article helpful?

Related Articles

opendentalsupport.com is an independent community resource. We are NOT affiliated with, endorsed by, or sponsored by Open Dental Software, Inc. Open Dental® is a registered trademark of Open Dental Software, Inc.