This is a MSSQL query that uses a Company_RecID to query for all tickets across all boards returning the board name, ticket counts and the sum of hours per board spent on tickets.



SELECT count(*) AS Tickets, [Board_Name] AS Board,
sum([Hours_Actual]) AS HoursUsed FROM [dbo].[v_rpt_Service]
WHERE datepart(month,getdate()) = datepart(month,[dbo].[v_rpt_Service].[date_entered])
and datepart(year,getdate()) = datepart(year,[dbo].[v_rpt_Service].[date_entered])
and [dbo].[v_rpt_Service].[company_recid] = ‘PLACE COMPANY ID HERE
GROUP BY [dbo].[v_rpt_Service].[Board_Name]


 Check out some of my other scripts like the one that queries Compant Data (Company_RecID’s) that you can use in conjuction with this script to get a report of each comapines ticket counts.