In our last monthly usage report we have numerous (but not all) ports' 95/5 usages being calculated with the transmit and receive values added rather than the highest value being used.
If it helps here is our report gen code:
DECLARE @StartDate DateTime
DECLARE @EndDate DateTime
SET @StartDate = DATEADD(d, DATEDIFF(d, 0, DATEADD(m, -1, DATEADD(d, 1 - day(getdate()), getdate()))), 0)
SET @EndDate = DATEADD(ms, -2,DATEADD(d, DATEDIFF(d, 0, DATEADD(d, 1 - day(getdate()), getdate())), 0))
SELECT Interfaces.InterfaceId,
Nodes.Caption AS NodeName,
Nodes.VendorIcon AS Vendor_Icon,
Interfaces.Caption AS Interface_Caption,
Interfaces.InterfaceIcon AS Interface_Icon,
Maxbps_In95 / 1000000.0 as Maxbps_In95,
Maxbps_Out95 / 1000000.0 as Maxbps_Out95,
Maxbps_95 / 1000000.0 as Maxbps_95
FROM dbo.Nodes
INNER JOIN dbo.Interfaces
ON (dbo.Nodes.NodeID = dbo.Interfaces.NodeID)
---------------------
INNER JOIN
(
SELECT InterfaceID, dbo.GetInBps95th(AA.InterfaceID, @StartDate, @EndDate) AS Maxbps_In95
FROM (
SELECT DISTINCT A.InterfaceID
FROM dbo.InterfaceTraffic A
WHERE A.DateTime >= @StartDate AND A.DateTime <= @EndDate
) AS AA
) as RESULT_IN
ON (dbo.Interfaces.InterfaceID = RESULT_IN.InterfaceID)
---------------------
INNER JOIN
(
SELECT InterfaceID, dbo.GetOutBps95th(AA.InterfaceID, @StartDate, @EndDate) AS Maxbps_Out95
FROM (
SELECT DISTINCT A.InterfaceID
FROM dbo.InterfaceTraffic A
WHERE A.DateTime >= @StartDate AND A.DateTime <= @EndDate
) AS AA
) as RESULT_OUT
ON (dbo.Interfaces.InterfaceID = RESULT_OUT.InterfaceID)
---------------------
INNER JOIN
(
SELECT InterfaceID, dbo.GetMaxBps95th(AA.InterfaceID, @StartDate, @EndDate) AS Maxbps_95
FROM (
SELECT DISTINCT A.InterfaceID
FROM dbo.InterfaceTraffic A
WHERE A.DateTime >= @StartDate AND A.DateTime <= @EndDate
) AS AA
) as RESULT_MAX
ON (dbo.Interfaces.InterfaceID = RESULT_MAX.InterfaceID)
--------------------
ORDER BY NodeName, Interface_Caption