SELECT statistics.datetime AS 'localuse', borrowers.surname,borrowers.firstname, borrowers.cardnumber, items.barcode, biblio.title FROM borrowers
LEFT JOIN statistics ON (statistics.borrowernumber=borrowers.borrowernumber)
LEFT JOIN items ON (items.itemnumber = statistics.itemnumber)
LEFT JOIN biblio ON (biblio.biblionumber = items.biblionumber)
WHERE statistics.type='localuse'
AND date(statistics.datetime)
BETWEEN <<Item issued BETWEEN (yyyy-mm-dd)|date>>
AND <<and (yyyy-mm-dd)|date>>
AND statistics.branch= <<Select library|branches>>
ORDER BY borrowers.surname ASC