2 Replies Latest reply on Jan 30, 2017 1:33 PM by cameron.owen

    Pulling information on newest traps from Orion.Traps

    cameron.owen

      I'm a bit perplexed.  I want to pull the number of traps received in the past 10 minutes.  When I do it using SQL:

       

      SELECT COUNT(TrapID) AS MYCOUNT

      FROM [dbo].[Traps]

      WHERE [dbo].[Traps].[DateTime] > DateAdd(minute, -10, GetDate())

       

      I get:  MYCOUNT = 5224

       

      When I do it using SWQL in SWQL Studio 2.1.13.0:

       

      SELECT COUNT(TrapID) AS MYCOUNT

      FROM Orion.Traps

      WHERE DateTime > AddMinute(-10, GetDate())

       

      I get:  MYCOUNT = 269749

       

      Given our volume of trap traffic, I wasn't expecting an exact match, but I was expecting the values to be within 10 or so.

       

      What am I doing wrong?

       

      C.