I am trying to write a SWQL query that will combine traffic statistics for multiple interfaces based on a custom property. I want to use this information to produce a custom chart in NPM. The problem is the query is not adding the traffic statistics together for each timestamp even though the timestamps appear to be the same. Here is the query I'm using:
SELECT IT.DateTime, SUM(InAveragebps) AS InAveragebps, SUM(OutAveragebps) AS OutAveragebps, I.CustomProperties.ASIC
FROM
Orion.NPM.InterfaceTraffic IT
INNER JOIN
Orion.NPM.Interfaces I
ON IT.InterfaceID = I.InterfaceID
INNER JOIN
Orion.Nodes N
ON I.NodeID = N.NodeID
WHERE
N.NodeID = ${NodeID}
AND
I.CustomProperties.ASIC IS NOT NULL
GROUP BY IT.DateTime, I.CustomProperties.ASIC
Here is an example of results that should be added together, but are not:
DATETIME | INAVERAGEBPS | OUTAVERAGEBPS | ASIC |
7/11/2014 8:39:36 PM | 355296.531 | 23240.4824 | 1 |
7/11/2014 8:39:36 PM | 373476.25 | 50935.29 | 1 |
7/11/2014 8:39:36 PM | 1026.50818 | 5912.86475 | 1 |
I suspect that the problem may be that the timestamps actually include milleseconds, which are not shown in the formatted date. How can I change the query so that it will ignore milliseconds, or even seconds for that matter?