[Koha] Koha MySQL Statement

Susan Bennett susan.bennett at geaugalibrary.info
Thu Oct 8 09:26:12 NZDT 2009


This is what we use:

SELECT
borrowers.cardnumber,borrowers.surname,borrowers.firstname,borrowers.phone,borrowers.branchcode,borrowers.categorycode,borrowers.address,borrowers.address2,borrowers.city,borrowers.zipcode,
items.homebranch, items.holdingbranch,items.itemcallnumber, items.location,
items.ccode,issues.date_due,biblio.author,biblio.title,items.barcode,items.replacementprice
FROM borrowers LEFT JOIN issues on (issues.borrowernumber =
borrowers.borrowernumber) LEFT JOIN items on (items.itemnumber =
issues.itemnumber) LEFT JOIN biblioitems on
(items.biblioitemnumber=biblioitems.biblioitemnumber) LEFT JOIN biblio on
(biblioitems.biblionumber=biblio.biblionumber)
WHERE issues.date_due < DATE_SUB(now(), INTERVAL *put in the number of days
overdue you are checking for* DAY) AND issues.returndate IS NULL ORDER BY
borrowers.surname asc

This has more fields then you need but it's easy to take the un-needed ones
out. Hope this helps!

Susan Bennett
ILS System Administrator
Geauga County Public Library
440 286-6811 x 125
440 286-7419 FAX


On Wed, Oct 7, 2009 at 3:54 AM, ahtshun83 <tony_ykt at yahoo.com> wrote:

>
> Hi all,
>
> I would like to extract out a list of patrons who has overdue books which
> has yet to return. I need the required field such as surname,card
> number,book borrowed & due date.
>
> is there anyone has a sample of the above script?
>
> appreciated and thank you in advanced
> --
> View this message in context:
> http://www.nabble.com/Koha-MySQL-Statement-tp25782087p25782087.html
> Sent from the Koha - Discuss mailing list archive at Nabble.com.
>
> _______________________________________________
> Koha mailing list
> 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/20091007/587371f4/attachment.htm 


More information about the Koha mailing list