The following SQL statements evaluate the distribution of incoming messages over time and thus give an indication of the times of greatest utilization.
SELECT DATEPART(hour,EntryDate) AS OnHour, COUNT(*) AS Totals FROM [eBiss3].[dbo].[Message] GROUP BY DATEPART(hour,EntryDate) order by OnHour asc
SELECT CAST(EntryDate as date) AS ForDate, DATEPART(hour,EntryDate) AS OnHour, COUNT(*) AS Totals FROM [eBiss3].[dbo].[Message] GROUP BY CAST(EntryDate as date), DATEPART(hour,EntryDate)
DECLARE @TotalMessages INT; SET @TotalMessages = select COUNT(*)from [eBiss3].[dbo].[Message]; SELECT DATEPART(hour,EntryDate) AS OnHour, COUNT(*) AS Totals, CAST(round(COUNT(*) * 100.0 /@TotalMessages, 1) as decimal(5,1)) as Percentage, REPLICATE ( '*' , COUNT(*) * 100.0 /@TotalMessages) as BarGraph FROM [eBiss3].[dbo].[Message] GROUP BY DATEPART(hour,EntryDate) order by OnHour asc