Skip to content

Instantly share code, notes, and snippets.

@StaniTr StaniTr/Part3
Created Jan 30, 2015

Embed
What would you like to do?
Entries LOGON Only (w/o LOGOFF)
SELECT Session_ID, TIMESTAMP, datediff(DAY, puzzsessions.TIMESTAMP, sysdatetime()) daysLogged --logOn time - (current)system time
FROM puzzSessions
--logon
WHERE ActionName='LOGON' AND session_id NOT IN
-- no LOGOFF
(SELECT Session_ID
FROM puzzSessions
WHERE ActionName='LOGOFF')
ORDER BY TIMESTAMP DESC --login from 15th and 16th dec 2014 :)))
--RESULT: 31 IDs - 3 LOGONs w/o LOGOFF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.