Re: [Koha] Items held by more than one branch

2018-04-24 Thread Cab Vinton
Thank you, Joy -- I think that did the trick. Nice work! Cab On Mon, Apr 23, 2018 at 7:09 PM, Joy Nelson wrote: > Cab - > This is a little (ok..a lot) quick and dirty, but does return results... > does this help? > > SELECT i.biblionumber,b.title, >

Re: [Koha] Items held by more than one branch

2018-04-23 Thread Joy Nelson
Cab - This is a little (ok..a lot) quick and dirty, but does return results... does this help? SELECT i.biblionumber,b.title, homebranch,itemcallnumber,barcode,itype,location,ccode,itemlost,withdrawn FROM items i LEFT JOIN biblio b USING (biblionumber) where biblionumber in (select biblionumber

Re: [Koha] Items held by more than one branch

2018-04-23 Thread Cab Vinton
Sorry, no dice -- returns a single item :-( The mysteries of SQL ... Cheers, Cab On Mon, Apr 23, 2018 at 5:06 PM, Paul Hoffman wrote: > On Mon, Apr 23, 2018 at 09:19:10AM -0400, Cab Vinton wrote: >> Trying to write a report that will provide details for items held by >> more

Re: [Koha] Items held by more than one branch

2018-04-23 Thread Paul Hoffman
On Mon, Apr 23, 2018 at 09:19:10AM -0400, Cab Vinton wrote: > Trying to write a report that will provide details for items held by > more than one branch, with separate output for each library's item. Put the HAVING clause inside a subquery that determines which bibs' items should be included --

Re: [Koha] Items held by more than one branch

2018-04-23 Thread Cab Vinton
Thank you, Jonathan. That fixes one problem (output now appears to be for the right bib numbers), but the GROUP function introduces another issue -- namely, it collapses the results so that just one item is show for each bib number: 14820 PLAISTOW 1572151714 : '20s & '30s style / Horsham,

Re: [Koha] Items held by more than one branch

2018-04-23 Thread Arshad Iqbal
Hi, I want to convert this checked in sql report into renew sql report. How i can convert this report. guide me. SELECT b.title, b.author, i.itemcallnumber, i.barcode, c.returndate FROM (SELECT iss.returndate, iss.itemnumber FROM issues iss, (SELECT @StartDate:=<>,@EndDate:=<>) AS var WHERE

Re: [Koha] Items held by more than one branch

2018-04-23 Thread Jonathan Druart
I'd say you are missing a group by. On Mon, 23 Apr 2018 at 10:19 Cab Vinton wrote: > Hi, all-- > > Another report question... > > Trying to write a report that will provide details for items held by > more than one branch, with separate output for each library's item. > >

[Koha] Items held by more than one branch

2018-04-23 Thread Cab Vinton
Hi, all-- Another report question... Trying to write a report that will provide details for items held by more than one branch, with separate output for each library's item. Including the statement HAVING COUNT(i.itemnumber) > 1 collapses the results to just one title. (Strangely, the bib