course filter

course filter

by Bear Hung -
Number of replies: 2

I add a course filter in my configurable report.

I follow http://docs.moodle.org/22/en/Configurable_reports

so my sql query looks like the follwing:

SELECT prefix_log.time,prefix_log.endtime,prefix_log.ip,prefix_course.fullname
FROM prefix_log
%%FILTER_COURSES:prefix_log.course%%
INNER JOIN prefix_course
ON prefix_log.course=prefix_course.id
WHERE ip='***.***.***.***'

When I finished setting,I clicked "View report" and choose a course category from the filter ,then clicked "add" , it showed"Error reading from database",but if  my sql query didn't have %%FILTER_COURSES:prefix_log.course%%, it was working!

So,what is the correct string in sql query when using filter?

Thank you very much

Average of ratings: -
In reply to Bear Hung

回應: course filter

by Bear Hung -

I know the solution is to move the %%FILTER_COURSES:prefix_log.course%% in the button of sql query