[Koha] Holds report

Wagner, Jane jwagner at ptfs.com
Fri Oct 30 03:05:29 NZDT 2009


One of my sites saw Chris's post and I've adapted it for three situations:  

Monthly holds placed by branch (Runs for previous month, counts holds placed in that month that have not been filled) : SELECT count(*),branchcode FROM reserves WHERE reservedate >= concat(date_format(LAST_DAY(now() - interval 1 month),'%Y-%m-'),'01') AND reservedate <= LAST_DAY(now() - interval 1 month) GROUP BY branchcode

Monthly holds placed and filled by branch (Runs for previous month;
counts holds both placed and filled in that month) : SELECT count(*),branchcode FROM old_reserves WHERE (timestamp like concat(date_format(LAST_DAY(now() - interval 1 month),'%Y-%m-%'))) AND (reservedate >= concat(date_format(LAST_DAY(now() - interval 1 month),'%Y-%m-'),'01') AND reservedate <= LAST_DAY(now() - interval 1 month)) AND Found = 'F' GROUP BY branchcode

Monthly holds filled by branch (Runs for previous month; counts all
holds filled in that month regardless of when placed) : SELECT count(*),branchcode FROM old_reserves WHERE (timestamp like concat(date_format(LAST_DAY(now() - interval 1 month),'%Y-%m-%'))) AND Found = 'F' GROUP BY branchcode


I've finally gotten around to registering on the wiki, so I'll add these and some other "monthly" reports to the SQL page.

Jane Wagner
Library Systems Analyst
PTFS Inc.
Content Management and Library Solutions
6400 Goldsboro Road, Suite 200
Bethesda, MD  20817
(301) 654-8088 x 151
jwagner at ptfs.com


-----Original Message-----
From: koha-bounces at lists.katipo.co.nz [mailto:koha-bounces at lists.katipo.co.nz] On Behalf Of David Schuster
Sent: Thursday, October 29, 2009 9:55 AM
To: koha at lists.katipo.co.nz
Subject: Re: [Koha] Holds report


Nag away!  Sometimes that's the only way to get people to do stuff!  At least
that's what I think my wife thinks...;)

David


Nicole Engard-2 wrote:
> 
> Melanie,
> 
> Make sure you check the SQL Library on the Wiki -
> http://wiki.koha.org/doku.php?id=sql_library
> 
> And Chris,
> 
> Make sure you add your report to the SQL Library on the Wiki -
> http://wiki.koha.org/doku.php?id=sql_library  :) hehe
> 
> Nicole
> (the nagging documentation manager)
> 
> On Tue, Oct 27, 2009 at 1:20 PM, Chris Cormack <chris at bigballofwax.co.nz>
> wrote:
>> 2009/10/28 Melanie Hedgespeth <melanie at salpublib.org>
>>>
>>> I need to create a report that lists the total number of holds placed
>>> for a month’s period.  (Able to separate that by library)
>>>
>>>
>>>
>>> Any tips on how I go about this?
>>>
>>>
>>
>> Hi Melanie
>>
>> Something like
>>
>> SELECT count(*),branchcode FROM reserves WHERE reservedate >=
>> '2009-09-01' AND reservedate <= '2009-09-30' GROUP BY branchcode
>>
>> Oughta work
>>
>> Chris
>> _______________________________________________
>> Koha mailing list
>> Koha at lists.katipo.co.nz
>> http://lists.katipo.co.nz/mailman/listinfo/koha
>>
> _______________________________________________
> Koha mailing list
> Koha at lists.katipo.co.nz
> http://lists.katipo.co.nz/mailman/listinfo/koha
> 
> 

-- 
View this message in context: http://www.nabble.com/Holds-report-tp26083314p26113490.html
Sent from the Koha - Discuss mailing list archive at Nabble.com.

_______________________________________________
Koha mailing list
Koha at lists.katipo.co.nz
http://lists.katipo.co.nz/mailman/listinfo/koha


More information about the Koha mailing list