Ok so working it out more I almost have it completed however there are some bad messages coming in that shouldn't stating NULL in the message any Advance SQL people please help! Driving myself crazy here.
SELECT Nodes.NodeID,Nodes.GroupStatus as img,Nodes.VendorIcon as vimg,Nodes.Caption AS Node,
(select TOP 1 Message from Events
where Message NOT LIKE '%Up%'
AND NetworkNode = Nodes.NodeID
AND (
( Events.EventType = 2) OR
( Events.EventType = 10) OR
( Events.EventType = 12) OR
( Events.EventType = 15) OR
( Events.EventType = 23) OR
( Events.EventType = 25) OR
( Events.EventType = 30) OR
( Events.EventType = 50) OR
( Events.EventType = 51) OR
( Events.EventType = 58) OR
( Events.EventType = 60) OR
( Events.EventType = 64) OR
( Events.EventType = 65) OR
( Events.EventType = 210) OR
( Events.EventType = 501) OR
( Events.EventType = 505) OR
( Events.EventType = 507) OR
( Events.EventType = 509) OR
( Events.EventType = 510) OR
( Events.EventType = 513) OR
( Events.EventType = 515) OR
( Events.EventType = 520) OR
( Events.EventType = 521) OR
( Events.EventType = 522) OR
( Events.EventType = 523) OR
( Events.EventType = 525) OR
( Events.EventType = 526) OR
( Events.EventType = 527) OR
( Events.EventType = 528) OR
( Events.EventType = 530) OR
( Events.EventType = 531) OR
( Events.EventType = 532) OR
( Events.EventType = 605) OR
( Events.EventType = 701) OR
( Events.EventType = 1001) OR
( Events.EventType = 1002) OR
( Events.EventType = 5000))
order by EventID DESC) as Message,
max(Events.EventTime) AS Event_Time, IP_Address
FROM Nodes
INNER JOIN (Events
INNER JOIN EventTypes Events_EventTypes ON (Events.EventType = Events_EventTypes.EventType)) ON (Events.NetworkNode = Nodes.NodeID)
INNER JOIN AlertStatus ON (ActiveObject = Events.NetObjectID AND Events.NetworkNode = Nodes.NodeID)
WHERE
((Nodes.Status in (0,3,4,7,8,10,12,14,15,16,17,19,24,25)) OR (Nodes.ChildStatus in (0,2,3,4,7,8,10,12,14,15,16,17,19,24,25))
OR (AlertStatus.State = 2))
group by Nodes.Caption,Nodes.GroupStatus,Nodes.VendorIcon,Nodes.NodeID,IP_Address
ORDER BY 6 DESC