0 Replies Latest reply on Oct 17, 2019 12:59 PM by mcmillrl

    Query returns a NULL

    mcmillrl

      Simple Query getting 1 rool not returming 1 row or return a null

       

      This works or at least passes the test?

      use SolarWindsOrion

       

      Select

      Case

             when traps.Message like '%oraEMNGEventTypeAttr1.1=Availability status=Up%' then 1

             when traps.Message like '%oraEMNGEventTypeAttr1.1=Availability status=Down%' then 2 

       

      end as status

      from traps

      where Timestamp=

             (Select Max(TimeStamp)

             from traps

             where traps.IPAddress='XXX.XXX.XXX.XX'

             )

       

      This returns Query results is NULL

      use SolarWindsOrion

       

      Select

      Case

             when traps.Message like '%aixRT.1.1.1 = Test snmptrap = Up%' then 1

             when traps.Message like '%aixRT.1.1.1 = Test snmptrap = Down%' then 2 

       

      end as status

      from traps

      where Timestamp=

             (Select Max(TimeStamp)

             from traps

             where traps.IPAddress='XXX.XXX.XXX.XX'

             )

      Basically the same.