Report Builder, checking log ins in a month?

By (Deleted User) - July 10, 2011

Is the Report Builder able to generate reports that would capture the number of all users (as a whole) have logged into the system over the last month, and it so, does anyone have any examples they could point at for this?

This would be not be referring to the total number of times they have logged in. The intention would be to grab just the number of users that are using the system within the last month, and not the usage frequency. Something like scanning the database and pulling back a count of how many people have a last log-in within the last 30 days or so.

Re: [cKopyar] Report Builder, checking log ins in a month?

By robin - July 11, 2011

Hey,

A query like this should help out:
SELECT *
FROM `<?php echo $TABLE_PREFIX ?>accounts`
WHERE lastLoginDate > DATE_SUB(NOW(),INTERVAL 30 DAY)


Hope that helps,
Robin
Robin
Programmer
interactivetools.com

Re: [robin] Report Builder, checking log ins in a month?

By (Deleted User) - July 24, 2011

Hey Robin...that is putting me on track. What I would be looking for is something to hook onto that will not only display the users who have logged in over the last 30 days, but also a flat total number of users that have logged in over the last 30 days.

Maybe I need to do this is two separate reports? I was thinking of listing the total number of user log-ins by month, but I really only need to be able to do the last 30 days. Any advice?

Re: [cKopyar] Report Builder, checking log ins in a month?

By robin - July 25, 2011

Hi,

A seperate report is a good idea if you want to pull any other kind of results.

CMS Builder only stores the last login date though, so the data is there to see how many individual users logged in the last month, but not how many times each. With that in mind - you just need to modify your query a little to pull a total:

SELECT count(*) as totalUsers
FROM `<?php echo $TABLE_PREFIX ?>accounts`
WHERE lastLoginDate > DATE_SUB(NOW(),INTERVAL 30 DAY)


Hipe that helps,
RObin
Robin
Programmer
interactivetools.com