Ad-hoc database queries

Reports ::: report_customsql
Maintained by Tim at Lone Pine Koala SanctuaryTim Hunt, at the OU (Perry building)Mahmoud Kassaei
This report plugin allows Administrators to set up arbitrary database queries to act as ad-hoc reports. Reports can be of two types, either run on demand, or scheduled to run automatically. Other users with the right capability can go in and see a list of queries that they have access to. Results can be viewed on-screen or downloaded as CSV.

Ad-hoc database queries 4.1 for Moodle 3.9+

Moodle 3.9, 3.10, 3.11
Released: Wednesday, July 7, 2021, 6:58 PM

Change log for the Ad-hoc database queries report

Changes in 4.1

  • We now track when each query was created and last modified, along with the user who modified it. (With the necessary Privacy API bits.)
  • Fix the sort-order of reports on the index page.
  • Fix the bug with list of email recipients being saved wrongly.
  • Fix a bug when the value in a cell ended in a backslash.
  • Minor styling fix.
  • Updates to make everything work with Moodle 3.11.

Version information

Version build number
Version release name
4.1 for Moodle 3.9+
Stable version
MD5 Sum
Supported software
Moodle 3.9, Moodle 3.10, Moodle 3.11
  • Latest release for Moodle 3.9
  • Latest release for Moodle 3.10
  • Latest release for Moodle 3.11

Version control information

Version control system (VCS)
VCS repository URL
VCS tag

Default installation instructions for plugins of the type Reports

  1. Make sure you have all the required versions.
  2. Download and unpack the module.
  3. Place the folder (eg "myreport") in the "report" subdirectory.
  4. Visit to finish the installation