Advertisement
Guest User

Untitled

a guest
Jan 30th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. SELECT Session_ID, TIMESTAMP, datediff(DAY, puzzsessions.TIMESTAMP, sysdatetime()) daysLogged --logOn time - (current)system time
  2. FROM puzzSessions
  3. --logon
  4. WHERE ActionName='LOGON' AND session_id NOT IN
  5. -- no LOGOFF
  6. (SELECT Session_ID
  7. FROM puzzSessions
  8. WHERE ActionName='LOGOFF')
  9. ORDER BY TIMESTAMP DESC --login from 15th and 16th dec 2014 :)))
  10. --RESULT: 31 IDs - 3 LOGONs w/o LOGOFF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement