# Get a count of staff using Leap per branch

**URL:** https://forum.innovativeusers.org/t/get-a-count-of-staff-using-leap-per-branch/2466
**Category:** Clearinghouse Repository
**Tags:** leap, sql, polaris
**Created:** [May 8, 2025, 11:18pm UTC](https://forum.innovativeusers.org/t/get-a-count-of-staff-using-leap-per-branch/2466 "2025-05-08T23:18:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![amihelich](https://forum.innovativeusers.org/user_avatar/forum.innovativeusers.org/amihelich/32/870_2.png) [@amihelich](https://forum.innovativeusers.org/u/amihelich)
#### Post date: [May 8, 2025, 11:18pm UTC](https://forum.innovativeusers.org/t/get-a-count-of-staff-using-leap-per-branch/2466/1 "2025-05-08T23:18:34Z")

</div>

Based on [This query to get a list of Leap logins,](https://forum.innovativeusers.org/t/get-a-list-of-leap-logins/1149) here’s a query to get a count of staff using Leap at each Branch. Which could help if you’re in a consortium and are working on moving staff over to Leap.

```auto
SELECT
    o.Name AS [Branch / Library],
	COUNT(DISTINCT pu.Name) as "User Count"

FROM
    PolarisTransactions.Polaris.TransactionHeaders th WITH (NOLOCK)

INNER JOIN -- Looking for system logins
    PolarisTransactions.Polaris.TransactionDetails td WITH (NOLOCK)
    ON (th.TransactionID = td.TransactionID AND td.TransactionSubTypeID = 235)
INNER JOIN
    Polaris.Polaris.Organizations o WITH (NOLOCK)
    ON (o.OrganizationID = th.OrganizationID)
INNER JOIN
    Polaris.Polaris.PolarisUsers pu WITH (NOLOCK)
    ON (pu.PolarisUserID = th.PolarisUserID)

WHERE -- System login
    th.TransactionTypeID = 7200
AND -- Leap login
    td.numValue = 38
AND -- Adjust dates as needed.
    th.TranClientDate BETWEEN '2025-04-01 00:00:00.000' AND '2025-04-30 23:59:59.999'

GROUP BY o.Name
ORDER BY "User Count"

```
