05/16/2023 05:24 PM
Could anyone explain me a way to export last login date for all users? by looking audit table, its taking too much time to query for all users..
05/16/2023 06:30 PM
Hi @ejeong
Below queries should give you desired output. Check userlogins table.
Thanks
05/16/2023 08:40 PM
I couldnt use this query it's taking very long time in our envrionment.
don't you face any issue when querying all users with this query?
05/17/2023 06:33 AM
I didn't execute this in Prod so don't know about timing. But yes you can limit the output by adding some condition in the where clause.
Thanks
05/16/2023 08:11 PM
select u.username,ul.logintime,ul.logoutdate from users u left join userlogins ul on u.userkey=ul.userkey group by ul.userkey order by ul.logintime desc
05/16/2023 08:34 PM
I tried to create report with query provided
but its taking long time as mentioned.
05/16/2023 09:06 PM
Last 30 days
select u.username,ul.logintime,ul.logoutdate from users u left join userlogins ul on u.userkey=ul.userkey
and ul.logintime BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE()
group by ul.userkey order by ul.logintime desc