I am using reporting
in Moodle
2.8. Some guy before me created the report
, which shows the summ
of all seminar days from 3 different plugins
, where the numbers are put just in a fields (and not complexly calculated). So I get the following table:
Username | Seminar Days | Year
--------+--------------+----------
John | 3 | 2013
Maria | 5 | 2013
Paul | 7 | 2012
The day are calculated by getting the days field from each seminar (and each from the 3 plugins), first with the following join we get the year:
'dateyear',
'LEFT',
'(SELECT DISTINCT YEAR(datefrom) AS year FROM {attendance} UNION ' .
'(SELECT DISTINCT YEAR(FROM_UNIXTIME(timestart)) AS year FROM {seminar_paricipants}) UNION ' .
'(SELECT DISTINCT YEAR(datefrom) AS year FROM {private_seminars}))',
'1',
REPORT_BUILDER_RELATION_ONE_TO_MANY
And the calculate the days with two more joins from the 3 plugins we have and display them in the column seminar days with CASE WHEN...
to check if some ar empty.
Is it possible to build filter function, so we can filter in the year
on quarter
(i.e from 01.01 until 31.03, from 01.04 until 31.06 etc.) basis?