Created On:  06 October 2011

Problem:

Is there a query that can be run against the StarTeam database that will return the last login date for each user?

Resolution:

The following SQL query will return the user name and datetime of last login for that user.

SELECT
  Full_Name AS [Full Name],
  dbo.convertSTTimestamp(MAX(Timestamp)) AS [Last Logon Time]
FROM
  syn_ObjectSecurityLog, syn_User
WHERE
  EventType = 1 --logon event
AND
  UserID = syn_User.ID
GROUP BY Full_Name

This query is optimized for SQL Server – the Oracle version may differ slightly.
Incident #2535753