[Koha] Need report help from the collection mind!

Kathy Rippel kdr at ckls.org
Wed Mar 30 07:49:56 NZDT 2011


I'm trying to build a simple weeding tool for one of my libraries and 
seem to be missing something. I am getting results where the 
Total_Circ is 2 or more!! The rest looks great, the results are just 
not narrow enough for this case.

Context may be slightly different because we are on LLEK, but I 
believe the problem is with the SQL at
WHERE items.homebranch='LX' AND 'Total_Circ'<2

We want everything where the Total Circ is less than two, obviously!

SELECT  CONCAT( '<a 
href=\"/cgi-bin/koha/cataloguing/additem.pl?biblionumber=',biblio.biblionumber, 
'\">',items.barcode,'</a>' ) as 
'Barcode',items.itemcallnumber,biblio.author,biblio.title,items.issues,items.renewals,(IFNULL(items.issues,0)+IFNULL(items.renewals,0)) 
as Total_Circ,items.datelastborrowed
FROM items
LEFT JOIN biblioitems on (items.biblioitemnumber=biblioitems.biblioitemnumber)
LEFT JOIN biblio on (biblioitems.biblionumber=biblio.biblionumber)
WHERE items.homebranch='LX' AND 'Total_Circ'<2
ORDER BY items.itemcallnumber,biblio.author,biblio.title

Kathy
Kathleen D. Rippel
Dept. Head/Consultant--Resource Sharing and Access ;
Pathfinder Central (Manager)
Central Kansas Library System
1409 Williams
Great Bend, KS 67530

(620-792-4865) phone
(800-362-2642) toll-free, KS
(620-792-5495) fax

kdr at ckls.org
********************************************************************************************
I'm currently reading: Magazine of Virginia genealogy, Feb. 2008
I'm currently listening to: The passage, by Justin Cronin.  



More information about the Koha mailing list