The following SQL query returns 230:
Select COUNT(*) AS 'NodeCount'
FROM [SolarWindsOrion].[dbo].[NodesStatistics]
WHERE [LastSync] < DATEADD(MINUTE, -1, GETDATE())
The following SWQL query against the same database within seconds of the first returns 42 which is incorrect:
SELECT COUNT(*) AS NodeCount FROM Orion.Nodes WHERE LastSync < ADDDATE('MINUTE', -1, GETDATE())
The following SQL query, again within seconds on the same database, returns 42:
Select COUNT(*) AS 'NodeCount'
FROM [SolarWindsOrion].[dbo].[NodesStatistics]
WHERE [LastSync] < DATEADD(DAY, -1, GETDATE())
While the following SWQL query, again within seconds on the same database, also returns 42:
SELECT COUNT(*) AS NodeCount FROM Orion.Nodes WHERE LastSync < ADDDATE('HOUR', -1, GETDATE())
A physical count of the Nodes with Last Sync older than 1 hour is 42 so both of the last two queries are correct. Why is the second query not working correctly?
Mike