<font size="2"><font face="verdana,sans-serif">Hi Shelley,<br><br>Try this query which lists the borrowers. It sorts the results first by the patron category and then alphabetically by name. It assumes that the patron category indicates the class. If this is not the case, you need to identify which borrower column contains the class information and use it in the query instead of the categorycode column.<br>

<br></font></font><div align="LEFT"><font color="#000000" face="Verdana" size="2">SELECT  borrowers.surname, borrowers.firstname, borrowers.cardnumber, borrowers.categorycode FROM borrowers ORDER BY borrowers.category code, borrowers.surname, borrowers.firstname</font></div>

<br clear="all"><br>* * * * <br>Beverly Church <br>LibLime Project Manager<br><br>phone: 1-888-564-2457 ext. 717 <br>            1-301-654-8088 ext. 292<br>email: <a href="mailto:bchurch@liblime.com" target="_blank">bchurch@liblime.com</a><br>

skype: beverlychurch<br>
<br><br><div class="gmail_quote">2011/3/8  <span dir="ltr">&lt;<a href="mailto:ksckemperman@chartermi.net">ksckemperman@chartermi.net</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div align="LEFT"><font color="#000000" face="Verdana" size="2">We&#39;ve just had our first week checking out books with Koha and it went very well - woohoo!</font></div><font color="#000000" face="Verdana" size="2"><br>

</font><div align="LEFT"><font color="#000000" face="Verdana" size="2">I have a report to list the students in each class.  I noticed that after the first week of checkouts, the report is listing the name of each student that checked out a book twice, even after the book is checked in.  To clarify, this report is just a list of each student in each class, not anything about books checked out, etc.  I can&#39;t figure out what to edit in the SQL so that I get just one line per student - any ideas?  This is the SQL for the 1st grade list:</font></div>

<font color="#000000" face="Verdana" size="2"><br></font><font color="#000000" face="Verdana" size="2"><br></font><div align="LEFT"><font color="#000000" face="Verdana" size="2">SELECT  borrowers.surname,borrowers.firstname,borrowers.cardnumber,borrowers.categorycode FROM borrowers LEFT JOIN statistics on (statistics.borrowernumber=borrowers.borrowernumber)  LEFT JOIN items on (items.itemnumber = statistics.itemnumber) LEFT JOIN biblioitems on (biblioitems.biblioitemnumber = items.biblioitemnumber) WHERE borrowers.categorycode=&#39;1ST&#39;</font></div>

<div align="LEFT"><font color="#000000" face="Verdana" size="2">ORDER BY borrowers.surname,borrowers.firstname</font></div><font color="#000000" face="Verdana" size="2"><br></font><div align="LEFT"><font color="#000000" face="Verdana" size="2">Thanks,</font></div>

<div align="LEFT"><font color="#000000" face="Verdana" size="2">Shelley</font></div><br>_______________________________________________<br>
Koha mailing list  <a href="http://koha-community.org" target="_blank">http://koha-community.org</a><br>
<a href="mailto:Koha@lists.katipo.co.nz">Koha@lists.katipo.co.nz</a><br>
<a href="http://lists.katipo.co.nz/mailman/listinfo/koha" target="_blank">http://lists.katipo.co.nz/mailman/listinfo/koha</a><br>
<br></blockquote></div><br>