Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

Active users who didn't login for X days report


Any idea how can I execute a report (or SQL query)of all users who are active but didn’t login to the system in the last x days?

Best Regards


See this thread - it is not easy to determine especially since if folks don’t log off TR - they are still active even if the browser is closed:


Hi BGanger,
I realized that it’s not easy, I wonder why is that.
How am I supposed maintain user list ? :disappointed:




SELECT,FROM_UNIXTIME(user_logins.updated_on) as’last_login’ FROM users INNER JOIN user_logins ON ( = WHERE users.is_active = 1 AND FROM_UNIXTIME(user_logins.updated_on) < ‘2018-03-01 00:00:00’;

will return in my case : lastlogin

I hope this query will help you :grin:


Perfect, Thank you!

Best Regards


I wish I knew why - maybe a vestige of an old system TR is based on? They do use Unix time so maybe how Unix handles sessions vs web? It is frustrating and any query is going to be… misleading. My production table has my last session as 3/6/2018 yet I have been using TR everyday for the past 2 weeks including today.