I think this requires some regex magic :) So, if anyone can help me out that would be great: How do I create a report for all records that have both of the following items? A 942|c field that says Photographs and a leader fields that shows item type as book? I know that the 94$c is mapped to biblioitems.itemtype - so that's not the issue, it's the Leader bit I need help with. Nicole
On 4 April 2012 14:38, Nicole Engard <nengard@gmail.com> wrote:
I think this requires some regex magic :) So, if anyone can help me out that would be great:
How do I create a report for all records that have both of the following items? A 942|c field that says Photographs and a leader fields that shows item type as book?
I know that the 94$c is mapped to biblioitems.itemtype - so that's not the issue, it's the Leader bit I need help with.
What chars in the leader tell me if its a book? Chris
From here: http://manual.koha-community.org/3.6/en/XSLTiTypes.html
leader6 = a (and one of the leader7 values below) leader7 = a leader7 = c leader7 = d leader7 = m leader6 = t On Tue, Apr 3, 2012 at 7:43 PM, Chris Cormack <chris@bigballofwax.co.nz> wrote:
On 4 April 2012 14:38, Nicole Engard <nengard@gmail.com> wrote:
I think this requires some regex magic :) So, if anyone can help me out that would be great:
How do I create a report for all records that have both of the following items? A 942|c field that says Photographs and a leader fields that shows item type as book?
I know that the 94$c is mapped to biblioitems.itemtype - so that's not the issue, it's the Leader bit I need help with.
What chars in the leader tell me if its a book?
Chris
On 4 April 2012 15:19, Nicole Engard <nengard@gmail.com> wrote:
From here: http://manual.koha-community.org/3.6/en/XSLTiTypes.html
leader6 = a (and one of the leader7 values below)
leader7 = a
leader7 = c
leader7 = d
leader7 = m
leader6 = t
Something like this then SELECT * FROM biblioitems, (SELECT biblioitemnumber,SUBSTR(marcxml,INSTR(marcxml, "<leader>")+8+6,1) AS leader6,SUBSTR(marcxml,INSTR(marcxml, "<leader>")+8+7,1) AS leader7 FROM biblioitems) AS leaders WHERE biblioitems.biblioitemnumber=leaders.biblioitemnumber AND (leaders.leader6 = 'a' AND (leader7 IN ('a','c','d','n')) OR leader6 = 't') AND itemtypes = 'your_itemtype goes here' Chris
Nope :( No results, and we know there are some problem records. I only made the following changes: SELECT CONCAT('<a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber=',biblionumber,'\">',biblionumber,'</a>') AS biblionumber FROM biblioitems, (SELECT biblioitemnumber,SUBSTR(marcxml,INSTR(marcxml, "<leader>")+8+6,1) AS leader6,SUBSTR(marcxml,INSTR(marcxml, "<leader>")+8+7,1) AS leader7 FROM biblioitems) AS leaders WHERE biblioitems.biblioitemnumber=leaders.biblioitemnumber AND (leaders.leader6 = 'a' AND (leader7 IN ('a','c','d','n')) OR leader6 = 't') AND itemtype = 'PHOTO' On Tue, Apr 3, 2012 at 8:43 PM, Chris Cormack <chris@bigballofwax.co.nz> wrote:
On 4 April 2012 15:19, Nicole Engard <nengard@gmail.com> wrote:
From here: http://manual.koha-community.org/3.6/en/XSLTiTypes.html
leader6 = a (and one of the leader7 values below)
leader7 = a
leader7 = c
leader7 = d
leader7 = m
leader6 = t
Something like this then
SELECT * FROM biblioitems, (SELECT biblioitemnumber,SUBSTR(marcxml,INSTR(marcxml, "<leader>")+8+6,1) AS leader6,SUBSTR(marcxml,INSTR(marcxml, "<leader>")+8+7,1) AS leader7 FROM biblioitems) AS leaders WHERE biblioitems.biblioitemnumber=leaders.biblioitemnumber AND (leaders.leader6 = 'a' AND (leader7 IN ('a','c','d','n')) OR leader6 = 't') AND itemtypes = 'your_itemtype goes here'
Chris
I found out that we're looking at too much in this. I removed a bit and now it all seems to work :) Nicole On Wed, Apr 4, 2012 at 9:44 AM, Nicole Engard <nengard@gmail.com> wrote:
Nope :( No results, and we know there are some problem records. I only made the following changes:
SELECT CONCAT('<a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber=',biblionumber,'\">',biblionumber,'</a>') AS biblionumber FROM biblioitems, (SELECT biblioitemnumber,SUBSTR(marcxml,INSTR(marcxml, "<leader>")+8+6,1) AS leader6,SUBSTR(marcxml,INSTR(marcxml, "<leader>")+8+7,1) AS leader7 FROM biblioitems) AS leaders WHERE biblioitems.biblioitemnumber=leaders.biblioitemnumber AND (leaders.leader6 = 'a' AND (leader7 IN ('a','c','d','n')) OR leader6 = 't') AND itemtype = 'PHOTO'
On Tue, Apr 3, 2012 at 8:43 PM, Chris Cormack <chris@bigballofwax.co.nz> wrote:
On 4 April 2012 15:19, Nicole Engard <nengard@gmail.com> wrote:
From here: http://manual.koha-community.org/3.6/en/XSLTiTypes.html
leader6 = a (and one of the leader7 values below)
leader7 = a
leader7 = c
leader7 = d
leader7 = m
leader6 = t
Something like this then
SELECT * FROM biblioitems, (SELECT biblioitemnumber,SUBSTR(marcxml,INSTR(marcxml, "<leader>")+8+6,1) AS leader6,SUBSTR(marcxml,INSTR(marcxml, "<leader>")+8+7,1) AS leader7 FROM biblioitems) AS leaders WHERE biblioitems.biblioitemnumber=leaders.biblioitemnumber AND (leaders.leader6 = 'a' AND (leader7 IN ('a','c','d','n')) OR leader6 = 't') AND itemtypes = 'your_itemtype goes here'
Chris
participants (2)
-
Chris Cormack -
Nicole Engard