Is there a table in the DB the shows a log of what players are online?
Thanks.
Thanks.
SELECT l.CharID, DATEDIFF(MINUTE, l.EventTime, GETDATE()) 'MinutesOnline', l.EventTime 'OnlineSince', COUNT(1) OVER (PARTITION BY c.EventID) 'OnlineCount' FROM dbo._LogEventChar c with(NOLOCK) JOIN (SELECT CharID, MAX(EventTime) 'EventTime' FROM dbo._LogEventChar with(NOLOCK) WHERE EventID in (4, 6) GROUP BY CharID) l on c.EventTime = l.EventTime AND c.CharID = l.CharID WHERE c.EventID = 4 ORDER BY MinutesOnline desc
Perfect thank you very much!Quote:
Noidea if that is accurate ;dCode:SELECT l.CharID, DATEDIFF(MINUTE, l.EventTime, GETDATE()) 'MinutesOnline', l.EventTime 'OnlineSince', COUNT(1) OVER (PARTITION BY c.EventID) 'OnlineCount' FROM dbo._LogEventChar c with(NOLOCK) JOIN (SELECT CharID, MAX(EventTime) 'EventTime' FROM dbo._LogEventChar with(NOLOCK) WHERE EventID in (4, 6) GROUP BY CharID) l on c.EventTime = l.EventTime AND c.CharID = l.CharID WHERE c.EventID = 4 ORDER BY MinutesOnline desc