This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Query returns a NULL

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.