I am trying to come up with a report that will list how many
items were checked out in each Dewey area, their barcode and date. If I could get
the author and title, that would be icing on the cake. I haven’t figured
out the last part. However, I figured out this for the first part:
SELECT
items.datelastborrowed,items.barcode,items.itemcallnumber,
(TO_DAYS(06/01/2009))-TO_DAYS(06/30/2009)) FROM borrowers LEFT JOIN statistics
on (statistics.borrowernumber=borrowers.borrowernumber) LEFT JOIN items on
(items.itemnumber = statistics.itemnumber) LEFT JOIN biblioitems on
(biblioitems.biblioitemnumber = items.biblioitemnumber) WHERE DATE
(items.datelastborrowed) BETWEEN '2009-06-01' AND '2009-06-30'
It shows that there are 3 pages of a report but when I run
the report, I receive the following message:
|
Content-type: text/html |
|||||||||||||
|
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" |
|||||||||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|||||||||||||
|
<html lang="en" xml:lang="en"
xmlns="http://www.w3.org/1999/xhtml"> |
|||||||||||||
|
<head><title>Koha Error</title></head> |
|||||||||||||
|
<body> |
|||||||||||||
|
|
|||||||||||||
|
<h1>Koha error</h1> |
|||||||||||||
|
<p>The following fatal
error has occurred:</p> |
|||||||||||||
|
<pre><code>Can't
use an undefined value as an ARRAY reference at
/home/slb/_kohaclone/reports/guided_reports.pl line 461. |
|||||||||||||
|
</code></pre> |
|||||||||||||
|
<table> |
|||||||||||||
|
<tr><th>Apache</th><td>
Server version: Apache/2.2.3 |
|||||||||||||
|
Server built:
Sep 8 2008 08:59:32 |
|||||||||||||
|
</td></tr> |
|||||||||||||
|
<tr><th>Koha</th><td>
3.01.00.032</td></tr> |
|||||||||||||
|
<tr><th>Koha
DB</th><td> 3.0100032</td></tr> |
|||||||||||||
|
<tr><th>MySQL</th><td>
mysql Ver 14.12 Distrib 5.0.32 |
for pc-linux-gnu (x86_64)
using readline 5.2 |
||||||||||||
|
</td></tr> |
|||||||||||||
|
<tr><th>OS</th><td>
Linux shin.ec2.liblime.com 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:34:28 EST
2008 x86_64</td></tr> |
|||||||||||||
|
<tr><th>Perl</th><td>
5.008008</td></tr> |
|||||||||||||
|
</table></body></html> |
|||||||||||||
I have constructed another report that gives me basically
what I want but shows everything that is checked out since we went live with
the system. That SQL is:
SELECT
items.datelastborrowed,items.itemcallnumber,items.barcode, FROM borrowers LEFT
JOIN statistics on (statistics.borrowernumber=borrowers.borrowernumber) LEFT
JOIN items on (items.itemnumber = statistics.itemnumber) LEFT JOIN biblioitems
on (biblioitems.biblioitemnumber = items.biblioitemnumber) ORDER BY
items.datelastborrowed desc,items.itemcallnumber desc,items.barcode desc
So how do I get the date in example one to work with example
2?
Scotty
"You must try
to generate happiness. If you aren't happy in one place, chances are you
won't be happy anyplace" Ernie Banks, former Chicago Cub