<br><br><div class="gmail_quote">Vali: Plz send your queries on mailing list. So that others can suggest some solutions.<br>---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Abdul Vali</b> <span dir="ltr"><<a href="mailto:abdul.vali99@gmail.com">abdul.vali99@gmail.com</a>></span><br>
Date: Tue, Jan 11, 2011 at 12:24 AM<br>Subject: Barcode Sorting Issue in Report<br><br><br><br>i have created a report in koha3 with the following sql:<br><br>SELECT
items.barcode,items.dateaccessioned,items.price,items.itemcallnumber,items.holdingbranch,biblioitems.biblioitemnumber,biblioitems.isbn,biblioitems.publicationyear,biblioitems.pages,biblioitems.size,biblioitems.place,biblio.title,biblio.author,biblio.copyrightdate
FROM items LEFT JOIN biblioitems on
(items.biblioitemnumber=biblioitems.biblioitemnumber) LEFT JOIN biblio
on (biblioitems.biblionumber=biblio.biblionumber) ORDER BY
(items.barcode) asc<br><br>now items.barcode field has values in alpha numeric (some are starting from 1, 2, 3, 4, etc and some barcodes are with prefix like m23, m45, m46, m67, etc ) but in my report i got the output in strange sorting order like:<br>
<br>items.barcode<br>----------------------<br><br>1565678<br>89765<br>u123456711<br>u12345679<br>....<br>....<br><br>but i want to sort numbers first, then barcodes with prefix. Can someone guide me how to do so?<br><br clear="all">
a friend of mine suggested me to use CAST in sql but i don't know what is this and how to use it<br><font color="#888888">-- <br>Regards<br><br>Abdul Vali<br>Librarian - ASE School<br><br><br>
</font></div><br>