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/28/2026

If you are struggling to identify which marketing efforts or word-of-mouth sources are actually bringing new patients into your practice, this query provides the clarity you need. By running this open dental new patient referral report, you can instantly see a list of new patients alongside their specific referral source for any given month.

The Query

Copy and paste the following code into your User Query window. You can adjust the SET dates at the top to match the specific time period you wish to analyze.

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

SELECT 
    p.LName, 
    p.FName, 
    p.DateFirstVisit, 
    r.LName AS ReferralLName, 
    r.FName AS ReferralFName,
    ref.RefType
FROM patient p
LEFT JOIN refattach ref ON p.PatNum = ref.PatNum AND ref.IsFrom = 1
LEFT JOIN referral r ON ref.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 modify this report to fit your specific needs by changing the values in the SET lines at the top of the query:

Variations

If you want to see only patients who have not been assigned a referral source yet, you can use this variation to help your front desk staff clean up missing data:

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

SELECT LName, FName, DateFirstVisit
FROM patient
WHERE DateFirstVisit >= @FromDate 
AND DateFirstVisit <= @ToDate
AND PatStatus = 0
AND PatNum NOT IN (SELECT PatNum FROM refattach WHERE IsFrom = 1);

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.