SELECT
	br.BibliographicRecordID,
    br.BrowseTitle,
    br.BrowseAuthor,
    br.CreationDate,
    br.ModificationDate,
    COUNT(DISTINCT cir.ItemRecordID) ItemsAssigned
FROM [PolarisTransactions].[Polaris].[TransactionHeaders] th (nolock)
inner join [PolarisTransactions].[Polaris].TransactionDetails td (nolock)
    on th.TransactionID = td.TransactionID
        and td.TransactionSubTypeID = 36
inner join polaris.polaris.PolarisUsers pu (nolock)
    on pu.PolarisUserID = th.PolarisUserID
INNER JOIN Polaris.BibliographicRecords br (nolock)
    on td.numValue = br.BibliographicRecordID
        and br.RecordStatusID = 1 -- include only Final records
LEFT JOIN polaris.CircItemRecords cir (nolock)
    on br.BibliographicRecordID = cir.AssociatedBibRecordID
where th.TransactionTypeID in (3002,3003)
	-- 3002 bib created
	-- 3003 bib modified
and th.TransactionDate > DATEADD(m, -3, current_timestamp) -- currently checking past 3 months, change the # for different range
and pu.name = 'jtenter' -- add your Polaris username in the brackets, without a domain (if used)

group by
	br.BibliographicRecordID,
    br.BrowseTitle,
    br.BrowseAuthor,
    br.CreationDate,
    br.ModificationDate
ORDER BY
    br.ModificationDate
