<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: MySQL Statements &#8211; for Koha Explorers Group</title>
	<atom:link href="http://www.nexpresslibrary.org/mysql-statements-for-koha-explorers-group/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nexpresslibrary.org/mysql-statements-for-koha-explorers-group/</link>
	<description></description>
	<lastBuildDate>Tue, 31 Aug 2010 23:25:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Sharon</title>
		<link>http://www.nexpresslibrary.org/mysql-statements-for-koha-explorers-group/comment-page-1/#comment-355</link>
		<dc:creator>Sharon</dc:creator>
		<pubDate>Tue, 03 Feb 2009 23:21:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.nexpresslibrary.org/?p=397#comment-355</guid>
		<description>Thank you for sharing - I will be working on our monthly suite of reports tomorrow (I hope).  We just discovered YESTERDAY that renewals are counted separately from check outs, so all of our circulation stats have been incomplete.  I&#039;m fixing that mistake now.</description>
		<content:encoded><![CDATA[<p>Thank you for sharing &#8211; I will be working on our monthly suite of reports tomorrow (I hope).  We just discovered YESTERDAY that renewals are counted separately from check outs, so all of our circulation stats have been incomplete.  I&#8217;m fixing that mistake now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Long</title>
		<link>http://www.nexpresslibrary.org/mysql-statements-for-koha-explorers-group/comment-page-1/#comment-353</link>
		<dc:creator>John Long</dc:creator>
		<pubDate>Tue, 03 Feb 2009 22:54:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.nexpresslibrary.org/?p=397#comment-353</guid>
		<description>Ok it turns out that wasn&#039;t very readable I had it broken up into sections, honest.</description>
		<content:encoded><![CDATA[<p>Ok it turns out that wasn&#8217;t very readable I had it broken up into sections, honest.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Long</title>
		<link>http://www.nexpresslibrary.org/mysql-statements-for-koha-explorers-group/comment-page-1/#comment-352</link>
		<dc:creator>John Long</dc:creator>
		<pubDate>Tue, 03 Feb 2009 22:53:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.nexpresslibrary.org/?p=397#comment-352</guid>
		<description>I&#039;ll go ahead and post a few of the reports I&#039;ve written that we&#039;ve found useful. I&#039;m not sure how readable this will be but here goes.

Report #1
This report was written to generate a shelf check/call list for 7, 14, 21, and 28 day overdues every day it is clicked. It was actually one of the first reports I wrote so the code could be a bit messy. Of note is the Interval section where you choose what day you want overdues for.

Select items.itemcallnumber,biblio.title,issues.date_due,borrowers.firstname,borrowers.surname,borrowers.categorycode,borrowers.phone,borrowers.email FROM items
LEFT JOIN biblioitems on (items.biblioitemnumber=biblioitems.biblioitemnumber) LEFT JOIN biblio on (biblioitems.biblionumber=biblio.biblionumber) 
LEFT JOIN issues on (items.itemnumber=issues.itemnumber)
LEFT JOIN borrowers on (issues.borrowernumber=borrowers.borrowernumber)
Where issues.date_due=DATE_SUB(curdate(), INTERVAL 7 DAY) AND issues.branchcode=&#039;INDEPENDNC&#039;

Report #2
This is a fairly simple report that when clicked generates a list of dvds added within the last two months. Again interval is where you adjust the time.

Select
biblio.title,
items.itemcallnumber,
items.dateaccessioned as &#039;Date Entered&#039;
from items
Left Join biblio on
(biblio.biblionumber=items.biblionumber)
Where
items.homebranch=&#039;independnc&#039;
and
items.itemcallnumber like &#039;dvd %&#039;
and items.dateaccessioned&gt;DATE_SUB(curdate(), INTERVAL 2 MONTH)

Report #3
This report is used in weekly reports to give a total of the circulation and renewals in a week for a given month. Date format is used so I can group by week, it&#039;s not the most elegant but it works.

select date_format(`datetime`,&quot;%X-%V&quot;) as &#039;Week&#039;, count(*) as &#039;Checkouts and Renews&#039; from statistics where datetime like &#039;2009-02%&#039; and branch=&#039;Independnc&#039; and type in (&#039;issue&#039;,&#039;renew&#039;) group by date_format(`datetime`,&quot;%X-%V&quot;)

Report #4
This is another weekly report to show the number of items entered in a week.

select date_format(`dateaccessioned`,&quot;%X-%V&quot;) as &#039;Week&#039;, count(*) as &#039;# of items&#039; from items where dateaccessioned like &#039;2009-02%&#039; and homebranch=&#039;Independnc&#039; group by date_format(`dateaccessioned`,&quot;%X-%V&quot;)

One thing to note is on some of the more complex reports it gets kind of buggy I wrote a report to total up circ and renewals for a month grouped by day and you can view the report but you can&#039;t go to the next page or download the report, I think the date format command is what causes this sort of thing though.</description>
		<content:encoded><![CDATA[<p>I&#8217;ll go ahead and post a few of the reports I&#8217;ve written that we&#8217;ve found useful. I&#8217;m not sure how readable this will be but here goes.</p>
<p>Report #1<br />
This report was written to generate a shelf check/call list for 7, 14, 21, and 28 day overdues every day it is clicked. It was actually one of the first reports I wrote so the code could be a bit messy. Of note is the Interval section where you choose what day you want overdues for.</p>
<p>Select items.itemcallnumber,biblio.title,issues.date_due,borrowers.firstname,borrowers.surname,borrowers.categorycode,borrowers.phone,borrowers.email FROM items<br />
LEFT JOIN biblioitems on (items.biblioitemnumber=biblioitems.biblioitemnumber) LEFT JOIN biblio on (biblioitems.biblionumber=biblio.biblionumber)<br />
LEFT JOIN issues on (items.itemnumber=issues.itemnumber)<br />
LEFT JOIN borrowers on (issues.borrowernumber=borrowers.borrowernumber)<br />
Where issues.date_due=DATE_SUB(curdate(), INTERVAL 7 DAY) AND issues.branchcode=&#8217;INDEPENDNC&#8217;</p>
<p>Report #2<br />
This is a fairly simple report that when clicked generates a list of dvds added within the last two months. Again interval is where you adjust the time.</p>
<p>Select<br />
biblio.title,<br />
items.itemcallnumber,<br />
items.dateaccessioned as &#8216;Date Entered&#8217;<br />
from items<br />
Left Join biblio on<br />
(biblio.biblionumber=items.biblionumber)<br />
Where<br />
items.homebranch=&#8217;independnc&#8217;<br />
and<br />
items.itemcallnumber like &#8216;dvd %&#8217;<br />
and items.dateaccessioned&gt;DATE_SUB(curdate(), INTERVAL 2 MONTH)</p>
<p>Report #3<br />
This report is used in weekly reports to give a total of the circulation and renewals in a week for a given month. Date format is used so I can group by week, it&#8217;s not the most elegant but it works.</p>
<p>select date_format(`datetime`,&#8221;%X-%V&#8221;) as &#8216;Week&#8217;, count(*) as &#8216;Checkouts and Renews&#8217; from statistics where datetime like &#8217;2009-02%&#8217; and branch=&#8217;Independnc&#8217; and type in (&#8216;issue&#8217;,'renew&#8217;) group by date_format(`datetime`,&#8221;%X-%V&#8221;)</p>
<p>Report #4<br />
This is another weekly report to show the number of items entered in a week.</p>
<p>select date_format(`dateaccessioned`,&#8221;%X-%V&#8221;) as &#8216;Week&#8217;, count(*) as &#8216;# of items&#8217; from items where dateaccessioned like &#8217;2009-02%&#8217; and homebranch=&#8217;Independnc&#8217; group by date_format(`dateaccessioned`,&#8221;%X-%V&#8221;)</p>
<p>One thing to note is on some of the more complex reports it gets kind of buggy I wrote a report to total up circ and renewals for a month grouped by day and you can view the report but you can&#8217;t go to the next page or download the report, I think the date format command is what causes this sort of thing though.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
