[Koha] creating a report for patrons without an email that have items overdue

Nicole Engard nengard at gmail.com
Thu Aug 13 07:54:29 NZST 2009


Just need to add the WHERE clause from the second one to the first:


SELECT borrowers.surname, borrowers.firstname, borrowers.cardnumber,
issues.date_due,(TO_DAYS(curdate())-TO_DAYS(date_due)) AS 'days
overdue',items.itemcallnumber, items.barcode, biblio.title, biblio.author
FROM borrowers LEFT JOIN issues ON
(borrowers.borrowernumber=issues.borrowernumber) LEFT JOIN items ON
(issues.itemnumber=items.itemnumber) LEFT JOIN biblio ON
(items.biblionumber=biblio.biblionumber) WHERE
(TO_DAYS(curdate())-TO_DAYS(date_due)) >= '28' AND homebranch = 'LIBRARY'
AND ' ' IN (borrowers.email) ORDER BY issues.date_due asc, borrowers.surname
ASC


Nicole

2009/8/12 Melanie Hedgespeth <melanie at salpublib.org>

> SELECT borrowers.surname, borrowers.firstname, borrowers.cardnumber,
> issues.date_due,
>
>        (TO_DAYS(curdate())-TO_DAYS(date_due)) AS 'days overdue',
>
>        items.itemcallnumber, items.barcode, biblio.title, biblio.author
>
> FROM borrowers
>
> LEFT JOIN issues ON (borrowers.borrowernumber=issues.borrowernumber)
>
> LEFT JOIN items ON (issues.itemnumber=items.itemnumber)
>
> LEFT JOIN biblio ON (items.biblionumber=biblio.biblionumber)
>
> WHERE (TO_DAYS(curdate())-TO_DAYS(date_due)) >= '28' AND homebranch =
> 'LIBRARY'
>
> ORDER BY issues.date_due asc, borrowers.surname ASC
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.katipo.co.nz/pipermail/koha/attachments/20090812/6b14e8c7/attachment.htm 


More information about the Koha mailing list