[Koha] Report for holds count by bib record & branch

Cab Vinton bibliwho at gmail.com
Wed Mar 28 05:30:28 NZDT 2018


Hi, All --

I'm trying to create a report that will give me hold counts broken down by
bib record and the patron's branch.

I believe what I have is pretty close, but some of the output omits the
item type information.

This is what I have:

SELECT count(borrowers.branchcode) AS Holds, borrowers.branchcode,
biblio.title, biblio.biblionumber, biblio.datecreated, items.itype
FROM reserves
LEFT JOIN borrowers USING (borrowernumber)
LEFT JOIN biblio USING (biblionumber)
LEFT JOIN items USING (itemnumber)
GROUP BY biblio.biblionumber, borrowers.branchcode
ORDER BY count(borrowers.branchcode) DESC, biblio.title

And some sample output:

Holdsbranchcodetitlebiblionumberdatecreateditype
6 KIMBALL Lilac girls : 142069 2016-04-19 BOOK
6 KIMBALL The woman in the window : 158162 2018-01-03 NEWBOOK
6 KIMBALL Victoria. The complete second season / 158595 2018-01-30 NEWMOVIE
4 SANDOWN Accidental heroes : 157156 2017-10-28
4 PLAISTOW Fall from grace : 156095 2017-09-12
4 KIMBALL The great alone / 156089 2017-09-12
3 SANDOWN I've got my eyes on you : 157150 2017-10-28
3 PLAISTOW Lilac girls : 142069 2016-04-19
3 SANDOWN Sweet vengeance / 157152 2017-10-28 NEWBOOK

Can anyone provide a fix?

Many thanks in advance,

Cab Vinton
Plaistow Public Library


More information about the Koha mailing list