Nice.
Also, if you are using Configurable Reports you could add a filter to this so you could choose your course from a dropdown list.
So:
WHERE (gi.courseid = c.id AND gi.itemname != 'Attendance')And then on the report's Filters tab, add the "Courses" filter.
%%FILTER_COURSES:c.id%%