Hi,
I am using Moodle 3.8
When I try to run this report:
SELECT # h.id, # e.customint1, h.name AS Cohort, h.idnumber AS Cohortid,CASEWHEN h.visible =1THEN'Yes'ELSE'-'ENDAS Cohortvisible, CONCAT('<a target="_new" href="%%WWWROOT%%/course/view.php',CHAR(63),'id=',c.id,'">',c.fullname,'</a>')AS Course FROM prefix_cohort h JOIN prefix_enrol e ON h.id = e.customint1 JOIN prefix_course c ON c.id = e.courseid %%FILTER_COURSES:e.courseid%% WHERE e.enrol ='cohort'AND e.roleid =5
It gives me this error:
"Error when executing the query: Error reading from database 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 '%FILTER_COURSES''.courseid%% WHERE e.enrol = 'cohort' AND e.roleid = 5 LIMIT 0' at line 13 SELECT # h.id, # e.customint1, h.name AS Cohort, h.idnumber AS Cohortid, CASE WHEN h.visible = 1 THEN 'Yes' ELSE '-' END AS Cohortvisible, CONCAT('',c.fullname,'') AS Course FROM mdl_cohort h JOIN mdl_enrol e ON h.id = e.customint1 JOIN mdl_course c ON c.id = e.courseid %%FILTER_COURSES?.courseid%% WHERE e.enrol = 'cohort' AND e.roleid = 5 LIMIT 0, 2 [array ( 0 => '', )]"