Hi every one
First of all, sorry for my English
I want to know, Which five users have the most logged in site in past six months؟
I have write fallowing script but I don't know how must limit date to 6 months ago..
SELECT DISTINCT
l.userid,u.email,
CONCAT (u.firstname, ' ', u.lastname) AS "Name",
COUNT(l.userid) AS "Number of Logins",l.timecreated
FROM mdl_logstore_standard_log l
JOIN mdl_user u ON u.id = l.userid
WHERE action = 'loggedin'
GROUP BY l.userid,"Name"
order by COUNT(l.userid) DESC
limit 5
thanks in advance
Solmaz