Really I am hard to get moodle enrolled and expired enrollment period of users report. I have tried many times to get this report so that I want to share you that mysql join query to run on database then get a report list with users which completed a course grade,user name,eamila ddress.

Here is the MYSQL Query:

SELECT c.shortname AS CourseName, CONCAT(mu.firstname, ‘ ‘, mu.lastname) AS fullname, as userEmailAddress, gg.finalgrade AS finalgrade
FROM mtl_grade_items AS gi
INNER JOIN mtl_course c ON = gi.courseid
LEFT JOIN mtl_grade_grades_history AS gg ON gg.itemid =
INNER JOIN mtl_user AS mu ON gg.userid =
WHERE gi.itemtype = ‘course’


moodle unenroll enroll users data

I hope it is help to you. Please share your thoughts.

8501 Total Views 1 Views Today

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>