<br><br><div class="gmail_quote">2009/11/3 Melanie Hedgespeth <span dir="ltr"><<a href="mailto:melanie@salpublib.org">melanie@salpublib.org</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal">I am trying to create a report for active patrons within a
specific month, divided up by patron category.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">(I see you can create a patron statistics report for patron
activity within “years”, but can’t get the code so I can
adjust it to a month’s period.) </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Any tips?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Thanks!</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><i><span style="font-size: 13.5pt; font-family: "Monotype Corsiva"; color: maroon;">Melanie Hedgespeth</span></i></p>
<p class="MsoNormal"><span style="font-size: 10pt;">Tech
Center Manager</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;">Salina
Public Library</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;">785.825.4624
Ext. 233</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;"><a href="mailto:melanie@salpublib.org" target="_blank"><span style="color: blue;">melanie@salpublib.org</span></a></span></p><br></div></div></blockquote></div><br>I assume by "active", you mean "checked out books", right? If so, you'd want something like this:<br>
<br>SELECT YEAR(issuedate), MONTH(issuedate), categorycode, COUNT(DISTINCT borrowernumber) FROM old_issues LEFT JOIN borrowers USING (borrowernumber) GROUP BY YEAR(issuedate), MONTH(issuedate), categorycode;<br clear="all">
<br>Because it uses old_issues, it won't include anything that's still checked out; getting around that requires either ugly subqueries or running the report with old_issues and issues and manually combining the results.<br>
<br>-- <br>Jesse Weaver<br>