[Koha] Another report request -- Active Cardholders

Church, Beverly bchurch at liblime.com
Thu Feb 10 10:48:05 NZDT 2011


Hi Cab,

Try this query. It uses the statistics table which contains both current and
history checkouts. The query looks for any patron whose most recent checkout
was on or after a specified date. The main disadvantage to this report is
that it could time out if the statistics table is very big.

select borrowers.surname, borrowers.firstname, borrowers.cardnumber,
borrowers.categorycode, borrowers.dateexpiry from statistics, borrowers
where statistics.borrowernumber = borrowers.borrowernumber and
statistics.type = 'issue' group by statistics.borrowernumber having
max(date(datetime)) >= 'YYYY-MM-DD' order by borrowers.surname,
borrowers.firstname

Bev

* * * *
Beverly Church
LibLime Project Manager

phone: 1-888-564-2457 ext. 717
            1-301-654-8088 ext. 292
email: bchurch at liblime.com
skype: beverlychurch


On Wed, Feb 9, 2011 at 4:20 PM, Cab Vinton <bibliwho at gmail.com> wrote:

> There is a promising report on the Koha wiki (List Active Patrons by
> Category for a Specific Month). However, it doesn't seem to be
> providing valid results, even after changing "old_issues" to "issues".
> (The latter change produces counts in the single digits.)
>
> We're looking for a count of active borrowers between two dates,
> broken down by categorycode. ("Active" meaning at least one checkout
> between the two dates.)
>
> Appreciate any help!
>
> Cab Vinton, Director
> Sanbornton Public Library
> Sanbornton, NH
> _______________________________________________
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> http://lists.katipo.co.nz/mailman/listinfo/koha
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.katipo.co.nz/pipermail/koha/attachments/20110209/2f9f01e9/attachment-0001.htm 


More information about the Koha mailing list