yes but do not work
Running query: CREATE EVENT if not exists qa_tupmevent ON SCHEDULE EVERY 1 MONTH starts concat(str_to_date ( concat(concat(DATE_FORMAT(NOW(), '%Y'),month(NOW() + interval 1 month)),"1"), '%Y%m%d'), ' 00:00:00') DO BEGIN insert into qa_userscores (userid, points, date) select userid, points, CURDATE() as date from qa_userpoints order by userid asc; insert into qa_monthlytoppers (date, userid, points) select CURDATE() - interval 1 month as date, a.userid, a.points - COALESCE(b.points,0) AS mpoints from qa_userscores a, qa_userscores b where a.userid = b.userid and a.date = CURDATE() and b.date between (a.date - interval 35 day) and (a.date - interval 25 day) group by a.userid,a.points,b.points having mpoints>0; END ...
Question2Answer was unable to perform the installation query below. Please check the user in the config file has CREATE and ALTER permissions:
CREATE EVENT if not exists qa_tupmevent
ON SCHEDULE EVERY 1 MONTH
starts concat(str_to_date ( concat(concat(DATE_FORMAT(NOW(), '%Y'),month(NOW() + interval 1 month)),"1"), '%Y%m%d'), ' 00:00:00')
DO
BEGIN
insert into qa_userscores (userid, points, date) select userid, points, CURDATE() as date from qa_userpoints order by userid asc;
insert into qa_monthlytoppers (date, userid, points) select CURDATE() - interval 1 month as date, a.userid, a.points - COALESCE(b.points,0) AS mpoints from qa_userscores a, qa_userscores b where a.userid = b.userid and a.date = CURDATE() and b.date between (a.date - interval 35 day) and (a.date - interval 25 day) group by a.userid,a.points,b.points having mpoints>0;
END
Error 1525: Incorrect STARTS value: 'NULL'