[Koha] need help with report

Church, Beverly bchurch at liblime.com
Wed Mar 9 03:36:12 NZDT 2011


Hi Shelley,

Try this query which lists the borrowers. It sorts the results first by the
patron category and then alphabetically by name. It assumes that the patron
category indicates the class. If this is not the case, you need to identify
which borrower column contains the class information and use it in the query
instead of the categorycode column.

SELECT  borrowers.surname, borrowers.firstname, borrowers.cardnumber,
borrowers.categorycode FROM borrowers ORDER BY borrowers.category code,
borrowers.surname, borrowers.firstname


* * * *
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


2011/3/8 <ksckemperman at chartermi.net>

> We've just had our first week checking out books with Koha and it went very
> well - woohoo!
>
> I have a report to list the students in each class.  I noticed that after
> the first week of checkouts, the report is listing the name of each student
> that checked out a book twice, even after the book is checked in.  To
> clarify, this report is just a list of each student in each class, not
> anything about books checked out, etc.  I can't figure out what to edit in
> the SQL so that I get just one line per student - any ideas?  This is the
> SQL for the 1st grade list:
>
>
> SELECT
> borrowers.surname,borrowers.firstname,borrowers.cardnumber,borrowers.categorycode
> FROM borrowers LEFT JOIN statistics on
> (statistics.borrowernumber=borrowers.borrowernumber)  LEFT JOIN items on
> (items.itemnumber = statistics.itemnumber) LEFT JOIN biblioitems on
> (biblioitems.biblioitemnumber = items.biblioitemnumber) WHERE
> borrowers.categorycode='1ST'
> ORDER BY borrowers.surname,borrowers.firstname
>
> Thanks,
> Shelley
>
> _______________________________________________
> 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/20110308/964c5b98/attachment.htm 


More information about the Koha mailing list