[Koha] Class reports

library library at katikaticollege.school.nz
Mon Nov 9 12:03:34 NZDT 2015

Hi everyone

I wonder if anyone can help me with my report. I am trying to adapt the
"Patrons with most checkouts in date range report" to enable me to print
borrowing statistics by classes which I have as an additional attribute. I
keep getting an error message

"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
'count(s.borrowernumber) AS checkouts FROM statistics s LEFT JOIN borrowers
b ' at line 2"

which is the part I didn't change.

This is as far as I have got in my report.

SELECT concat(b.surname,', ',b.firstname) AS name, a.code, a.attribute,
       count(s.borrowernumber) AS checkouts
FROM statistics s
LEFT JOIN borrowers b USING (borrowernumber)
LEFT JOIN borrower_attributes a USING (borrowernumber)
WHERE c.branchcode = 'KKC' AND  s.datetime BETWEEN <<Top checkouts BETWEEN
(yyyy-mm-dd)|date>> AND <<and (yyyy-mm-dd)|date>>
WHERE a.code = Class AND a.attribute=<<Class>>

Ann Murphy
Katikati College

More information about the Koha mailing list