[Koha] Report Help

Nicole Engard nengard at gmail.com
Tue Apr 23 07:18:48 NZST 2013


I'm looking to change this report around.  It shows patrons with their
guarantor information.  I want a report that shows me the guarantees for
each guarantor instead.


SELECT p.categorycode, p.dateofbirth, p.cardnumber, p.surname, p.firstname,
p.dateexpiry,  IFNULL(concat(g.surname, ', ', g.firstname, ' (',
g.cardnumber, ')'),'') AS guarantor, p.relationship,
ifnull(FORMAT(SUM(a.amountoutstanding),2),'0.00') AS due
FROM borrowers p
LEFT JOIN accountlines a USING (borrowernumber)
LEFT JOIN borrowers g ON (p.guarantorid=g.borrowernumber)
WHERE p.dateexpiry < NOW()
GROUP BY p.borrowernumber
ORDER BY p.dateexpiry ASC



Nicole


More information about the Koha mailing list