[Koha] New patrons SQL Report

muiru james muirunyeri at gmail.com
Sat Nov 21 21:54:48 NZDT 2020


Hello team,

I need a report that counts and sums new patrons registered within a
certain date range by gender for each category.

How can I enhance this report? I dont mind a different on delivering
results.

SELECT categorycode, COUNT(borrowernumber) AS 'new patrons'
FROM (SELECT borrowernumber, categorycode, dateenrolled FROM borrowers
UNION ALL
SELECT borrowernumber, categorycode, dateenrolled FROM deletedborrowers) AS
patrons
WHERE dateenrolled BETWEEN <<Added BETWEEN (yyyy-mm-dd)|date>> AND <<and
(yyyy-mm-dd)|date>>
GROUP BY categorycode

It is not giving me the count by gender. I also want a drop down arrow
allowing me to select the category that I want.

Warm Regards

James


More information about the Koha mailing list