Guru: Analyzing User Session Statistics, Part 1
July 20, 2026 Mike Larsen
I wanted to report on user activity on our IBM i. Knowing that there is a wealth of SQL table functions available to me, I knew it wouldn’t be hard to find something that would help me. For this report, I wanted to see how many times a user logged into the system during a certain timeframe.
The table function I used is QSYS2.HISTORY_LOG_INFO. I’ll show the code I built, followed by a breakdown of what is does.
Here is the SQL statement to determine the number of times a user signed in:
SELECT COUNT(DISTINCT DATE(MESSAGE_TIMESTAMP)) AS DAYS_LOGGED_IN FROM… Read more
