[Koha] Catalogue - SQL Report Help (Paul A)

Heather Braum (NEKLS) hbraum at nekls.org
Thu Dec 11 15:06:35 NZDT 2014


Kerrie, to select by homebranch, you just need to add a branch parameter,
i.homebranch=<<choose branch|branches>>

So the statement will now look like

SELECT DISTINCT b.biblionumber, b.title, b.author, t.editionstatement,
t.publishercode, t.isbn, i.ccode, count(i.itemnumber) FROM biblio b LEFT
JOIN
biblioitems t USING(biblionumber) LEFT JOIN items i USING(biblionumber)
WHERE i.homebranch=<<Choose branch|branches>> GROUP BY b.biblionumber

In case anyone is interested in learning more, parameters are further
explained on the Koha community wiki (
http://wiki.koha-community.org/wiki/SQL_Reports_Library#Runtime_Parameters).
There's two basic kinds of parameters (that I at least use a lot with Koha
report writing on my system) -- and you can add multiple parameters to your
reports:

1. Add option to add text manually --> Examples: i.ccode=<<Enter collection
code>> OR i.homebranch=<<Enter homebranch>>

You then would type the corresponding branchcode or collection code into
the text box when running the report (the two examples mentioned use
branchcode or collection code, but this method works for lots of other
fields in Koha, too)

OR

2. Add option to Choose from dropdown list --> Examples: i.ccode=<<Choose
collection code|CCODE>> OR i.homebranch=<<Choose homebranch|branches>>
(what you use after the | character may vary a little bit, depending on
what field you're setting up the parameter for).

Hope this helps!

Heather Braum
NExpress Coordinator
Resource Sharing Librarian
Northeast Kansas Library System
hbraum at nekls.org

"The illiterate of the 21st century will not be those who cannot read
and write, but those who cannot learn, unlearn, and relearn." ~Alvin
Toffler, *Rethinking the Future*




On Wed, Dec 10, 2014 at 7:19 PM, Kerrie Stevens <KStevens at harvest.edu.au>
wrote:

> Hi Paul & Heather,
>
> The report you developed for Satish below is very helpful, but I'd like to
> tweak it a little differently -  I've tried every variation I can think of
> with no luck (I don't have very much SQL experience)... how can I get it to
> select by branch, rather than collection code?
>
> SELECT DISTINCT b.biblionumber, b.title, b.author, t.editionstatement,
> t.publishercode, t.isbn, i.ccode, count(i.itemnumber) FROM biblio b LEFT
> JOIN
> biblioitems t USING(biblionumber) LEFT JOIN items i USING(biblionumber)
> WHERE i.ccode=<<Enter collection code>> GROUP BY b.biblionumber
>
> Thanks so much for your sharing of this report.
>
> Kerrie Stevens
> Harvest Bible College
> Melbourne, Australia
> _______________________________________________
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> http://lists.katipo.co.nz/mailman/listinfo/koha
>


More information about the Koha mailing list