[Koha] Overdue report/count at year-end

Steven Nickerson snicker1 at maine.rr.com
Mon Aug 4 07:23:30 NZST 2014


I decided to go ahead and try to implement prompting for the year inside of
the Koha report and here's the SQL I came up with (enter the year twice when
prompted):

SELECT month(returndate) AS `MONTH`, COUNT(*) AS `OVERDUES`
FROM old_issues WHERE returndate > date_due AND returndate > concat(<<START
YEAR (yyyy)>>,'-01-01 00:00:00') AND returndate < concat(<<END YEAR
(yyyy)>>,'-12-31 23:59:59')
GROUP BY month(returndate) WITH ROLLUP;

Perhaps this may be a useful report to others..."Number of overdues per
month".  You can actually enter a different "start year" and "end year" and
it still shows the number of overdues by month...maybe you'll see some
trends where patrons are consistently returning items late in one particular
month???

Steve



More information about the Koha mailing list