# Finding patrons with invalid phone numbers (Polaris Find Tool SQL)

**URL:** https://forum.innovativeusers.org/t/finding-patrons-with-invalid-phone-numbers-polaris-find-tool-sql/2808
**Category:** Polaris Repository
**Created:** [January 29, 2026, 6:51pm UTC](https://forum.innovativeusers.org/t/finding-patrons-with-invalid-phone-numbers-polaris-find-tool-sql/2808 "2026-01-29T18:51:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![wesochuck](https://forum.innovativeusers.org/user_avatar/forum.innovativeusers.org/wesochuck/32/499_2.png) [@wesochuck](https://forum.innovativeusers.org/u/wesochuck)
#### Post date: [January 29, 2026, 6:51pm UTC](https://forum.innovativeusers.org/t/finding-patrons-with-invalid-phone-numbers-polaris-find-tool-sql/2808/1 "2026-01-29T18:51:04Z")

</div>

Below is a query that can be used in a **Patron Find Tool SQL Search** to locate patrons whose phone numbers don’t cleanly resolve to a standard 10-digit numeric value.

**What it does:**

- Checks PhoneVoice1, PhoneVoice2, and PhoneVoice3 for each patron

- Strips common formatting characters (spaces, dashes, dots, parentheses, plus signs)

- Returns **distinct PatronIDs** where the cleaned phone number:

This can identify records that may need cleanup before notices, SMS integrations, or data exports.

```sql
SELECT DISTINCT
    p.PatronID
FROM Polaris.Polaris.PatronRegistration AS p
CROSS APPLY (VALUES (p.PhoneVoice1), (p.PhoneVoice2), (p.PhoneVoice3)) AS v(Phone)
CROSS APPLY (
    SELECT
        CleanPhone =
            REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
                LTRIM(RTRIM(v.Phone)),
                '(', ''), ')', ''), '-', ''), '.', ''), ' ', ''), '+', '')
) AS c
WHERE
    v.Phone IS NOT NULL
    AND LTRIM(RTRIM(v.Phone)) <> ''
    AND (
        LEN(c.CleanPhone) <> 10
        OR c.CleanPhone LIKE '%[^0-9]%'
    )

```
