[Koha] Help with a report query

Carlos Lopez clopez at dml.vic.edu.au
Tue Sep 24 12:51:15 NZST 2019


Hi folks

I have the following report query:
----
SELECT monthname(datetime) month, type, count(datetime) as count
from statistics
where YEAR(datetime) = YEAR(NOW())
and type in ('issue', 'renew')
GROUP BY month, type
ORDER BY month(datetime)
----

This works well but I've been asked to provide a mechanism to select the year to run this for (I would guess similar to the construct " DATE (b.dateexpiry)  BETWEEN <<Between (yyyy-mm-dd)|date>> AND <<and (yyyy-mm-dd)|date>>", except selecting only years)

Is it possible to do this? And if so, how?


With kind regards from the Dalton McCaughey Library Team

Carlos Lopez

Dalton McCaughey Library | 29 College Crescent, Parkville, VICTORIA 3052
Ph: 03 9340 8888 ext.1 | library at dml.vic.edu.au | library.dmlibrary.org.au 



More information about the Koha mailing list