[Koha] New SQL Reports - Records/ authorities added within time frame

Cab Vinton bibliwho at gmail.com
Thu Jun 6 08:59:47 NZST 2013


Enjoy.

Cab Vinton

Bib records added/deleted in time frame
Developer: Nicole C. Engard, ByWater Solutions
Module: Statistical (Catalog)
Purpose: This report will show the bibs added/deleted at a branch in a
time period.

SELECT l.action, count(l.timestamp) AS 'bibs'
FROM action_logs l
LEFT JOIN borrowers p ON (p.borrowernumber=l.user)
WHERE module='CATALOGUING' AND p.branchcode=<<Branch|branches>>
      AND date(l.timestamp) BETWEEN <<Between (yyyy-mm-dd)>> AND <<and
(yyyy-mm-dd)>>
      AND l.info!='item'
GROUP BY l.action

Item records added/deleted in time frame
Developer: Nicole C. Engard, ByWater Solutions
Module: Statistical (Catalog)
Purpose: This report will show the items added/deleted at a branch in
a time period.
IMPORTANT: Only works if you're logging cataloging actions.

SELECT l.action, count(l.timestamp) AS 'items'
FROM action_logs l
LEFT JOIN borrowers p ON (p.borrowernumber=l.user)
WHERE module='CATALOGUING' AND p.branchcode=<<Branch|branches>>
      AND date(l.timestamp) BETWEEN <<Between (yyyy-mm-dd)>> AND <<and
(yyyy-mm-dd)>>
      AND l.info='item'
GROUP BY l.action

Authorities records added/deleted in time frame
Developer: Nicole C. Engard, ByWater Solutions
Module: Statistical (Catalog)
Purpose: This report will show the authorities added/deleted at a
branch in a time period.
IMPORTANT: Only works if you're logging authority actions.

SELECT l.action, count(l.timestamp) AS 'authorities'
FROM action_logs l
LEFT JOIN borrowers p ON (p.borrowernumber=l.user)
WHERE module='AUTHORITIES' AND p.branchcode=<<Branch|branches>>
      AND date(l.timestamp) BETWEEN <<Between (yyyy-mm-dd)>> AND <<and
(yyyy-mm-dd)>>
GROUP BY l.action


More information about the Koha mailing list