I have this report that shows me item with no checkouts in a number of
days, but how about showing items with fewer than X checkouts in that same
number of days?

SELECT b.title, b.author, i.itemcallnumber, i.barcode, i.datelastseen,
i.datelastborrowed, i.issues as 'total checkouts ever', i.renewals as
'total renewals ever'
FROM biblio b
JOIN items i USING (biblionumber)
WHERE i.itemnumber NOT IN
     (SELECT DISTINCT itemnumber
      FROM statistics
      WHERE type = 'issue' AND
      (TO_DAYS(curdate())-TO_DAYS(datetime)) > <<No checkouts in X days>>)
and i.dateaccessioned <= <<Acquired on or before (yyyy-mm-dd)|date>>
_______________________________________________
Koha mailing list  http://koha-community.org
Koha@lists.katipo.co.nz
http://lists.katipo.co.nz/mailman/listinfo/koha

Reply via email to