TMSP High Tag Read Count last 24 hours by location
Query to show how many times a tag or tags have been read in the past 24 hours at a TMPS site.
Select b.*, (c.container_nbr + right(a.total,5))[TMSP_Tag_Number] from (
select count (*) TagReadCount, Max(InventoryLocation) MostReadInventoryLocation --,MIN(InventoryLocation) SecondaryInventoryLocation
, TagNumber from TagReadEvents
where CAST(CreatedOnUtc AS DATE) = CAST(GETDATE() -1 AS DATE)
group by TagNumber)b
join asset a on a.total =TagNumber
join container c on a.container_id = c.container_id
where MostReadInventoryLocation like '%TBN%'
order by TagReadCount desc
select count (*) TagReadCount, Max(InventoryLocation) MostReadInventoryLocation --,MIN(InventoryLocation) SecondaryInventoryLocation
, TagNumber from TagReadEvents
where CAST(CreatedOnUtc AS DATE) = CAST(GETDATE() -1 AS DATE)
group by TagNumber)b
join asset a on a.total =TagNumber
join container c on a.container_id = c.container_id
where MostReadInventoryLocation like '%TBN%'
order by TagReadCount desc