[Koha] Report help needed - filter by itemtype

Elaine Bradtke eb at efdss.org
Sat Jun 7 08:42:40 NZST 2014


I can't seem to get the report to filter on item type.  Probably another
typo somewhere. it works if I take out this
line: biblioitems.itemtype=‘BK’   But I want to filter by books (and
eventually other item types).


SELECT
ExtractValue(b.marcxml, '//datafield[@tag="100"]/subfield[@code="a"]'),
ExtractValue(b.marcxml, '//datafield[@tag="245"]/subfield[@code="a"]'),
ExtractValue(b.marcxml, '//datafield[@tag="245"]/subfield[@code="b"]'),
ExtractValue(b.marcxml, '//datafield[@tag="245"]/subfield[@code="c"]'),
ExtractValue(b.marcxml, '//datafield[@tag="260"]/subfield[@code="a"]'),
ExtractValue(b.marcxml, '//datafield[@tag="773"]/subfield[@code="t"]'),
ExtractValue(b.marcxml, '//datafield[@tag="773"]/subfield[@code="g"]'),
ExtractValue(b.marcxml, '//datafield[@tag="260"]/subfield[@code="b"]'),
ExtractValue(b.marcxml, '//datafield[@tag="260"]/subfield[@code="c"]'),
ExtractValue(b.marcxml, '//datafield[@tag="300"]/subfield[@code="a"]'),
ExtractValue(b.marcxml, '//datafield[@tag="020"]/subfield[@code="a"]'),
ExtractValue(b.marcxml, '//datafield[@tag="022"]/subfield[@code="a"]'),
monthname(datecreated) AS month,
year(datecreated) AS year,
biblionumber AS biblionumber
LEFT JOIN biblioitems b USING (biblionumber)
FROM biblio
WHERE biblioitems.itemtype=‘BK’ AND datecreated
BETWEEN <<Between (yyyy-mm-dd)>> AND <<and (yyyy-mm-dd)>>

-- 
Elaine Bradtke
Data Wrangler
VWML
English Folk Dance and Song Society | http://www.efdss.org
Cecil Sharp House, 2 Regent's Park Road, London NW1 7AY
Tel    +44 (0) 20 7485 2206 (This number is for the English Folk Dance and
Song Society in London, England. If you wish to phone me personally, send
an e-mail first. I work off site)
--------------------------------------------------------------------------
Registered Company No. 297142
Charity Registered in England and Wales No. 305999
---------------------------------------------------------------------------
"Writing about music is like dancing about architecture"
--Elvis Costello (Musician magazine No. 60 (October 1983), p. 52)


More information about the Koha mailing list