Remember that there is a SQL reports list on the wiki- add your reports there and check there first to see if someone else has already written the report you're looking for: http://wiki.koha.org/doku.php?id=sql_library Nicole 2009/10/7 Susan Bennett <susan.bennett@geaugalibrary.info>:
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@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@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________ Koha mailing list Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha