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.

New Patient Referral Report Query

SQL Queries3 min read3/31/2026

If you are struggling to identify which marketing efforts or referral sources are actually bringing new patients into your practice, this query provides the clarity you need. By pulling a list of new patients alongside their attached referral source, you can easily see which channels are driving your growth.

The Query

/* Set your date range here */
SET @FromDate = '2026-01-01';
SET @ToDate = '2026-03-31';

SELECT 
    p.LName, 
    p.FName, 
    p.DateFirstVisit, 
    r.LName AS ReferralLName, 
    r.FName AS ReferralFName,
    ra.RefType
FROM patient p
LEFT JOIN refattach ra ON p.PatNum = ra.PatNum AND ra.IsFrom = 1
LEFT JOIN referral r ON ra.ReferralNum = r.ReferralNum
WHERE p.DateFirstVisit >= @FromDate 
AND p.DateFirstVisit <= @ToDate
AND p.PatStatus = 0
ORDER BY p.DateFirstVisit;

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.

Understanding the Results

How to Customize

You can easily adjust the timeframe of your report by changing the dates in the SET lines at the very top of the query.

Variations

If you want to see only patients who were referred by other patients (to track your internal referral program), you can add a filter to the end of the query:

-- Add this before the ORDER BY clause
AND r.IsDoctor = 0

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.