I am using this code for generating a Certificate report in Moodle 3.0
SELECT u.firstname, u.lastname, l.timecreated
DATE_FORMAT(FROM_UNIXTIME(l.timecreated),"%Y-%m-%d") AS Certificate Date,
FROM prefix_certificate_issues l
JOIN prefix_user u ON l.userid = u.id
JOIN prefix_certificate t ON l.certificateid = t.id
JOIN prefix_course c ON t.course = c.id
ORDER BY l.timecreated
But keep getting this error with the timestamp. I've added commas and removed them to no avail.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(FROM_UNIXTIME(l.timecreated),"%Y-%m-%d") AS Certificate Date, FROM wpq_certi' at line 3Can anyone direct me? I need a nicely formatted Certificate report.