To know the last access of a Login to a database in SQL Server; Perform the following query to obtain dates however the LOGINPROPERTY function does not contain the last login date of Login.
SELECT
dbp.name AS [nombreUsuarioBD],
slg.name AS [nombreLogin],
LOGINPROPERTY ( slg.name , 'PasswordLastSetTime') AS
[ultimoCambioContraseña] ,
LOGINPROPERTY ( slg.name , 'LockoutTime') AS [fechaDeBloqueo],
LOGINPROPERTY ( slg.name , 'BadPasswordTime') AS
[ultimoIntentoContraseñaIncorrecta]
FROM sys.sql_logins slg
INNER JOIN
sys.database_principals dbp
ON slg.sid = dbp.sid
WHERE slg.type IN ('U','S')
and consult the table by consulting the "accdate" column, however, it does not include exact information.
SELECT
name,
accdate
FROM
sys.syslogins