[Koha] Help with sql statement.

Nicole Engard nengard at gmail.com
Mon Jun 11 22:37:35 NZST 2012


This should work:

SELECT b.code,c.code,COUNT(*)
  FROM borrowers WHERE DATE(dateenrolled)  between <<Date between (yyyy-mm-dd)>>
  AND <<and (yyyy-mm-dd)>> and b.code = <<Pick your branch|branches>>
  GROUP BY c.code

On Sat, Jun 9, 2012 at 7:55 PM, Jared Camins-Esakov
<jcamins at cpbibliography.com> wrote:
> James,
>
>
> I am trying to get the new patron report developed by Sharon Moreland, to
>> do a date range and have a location selection for San Benito County Free
>> Library.  I am sure I am doing something wrong, please advise as necessary,
>>
>> SQL:
>>
>> SELECT b.code,c.code,COUNT(*)
>> FROM borrowers WHERE DATE(dateenrolled)  between <<Date
>> between (yyyy-mm-dd)>> AND DATE(dateenrolled)= <<and (yyyy-mm-dd)>> and
>> b.code=<<Pick your branch|branches>>
>> GROUP BY c.code
>>
>
> You have an extra = after the second DATE(dateenrolled)
>
> Regards,
> Jared
>
> --
> Jared Camins-Esakov
> Bibliographer, C & P Bibliography Services, LLC
> (phone) +1 (917) 727-3445
> (e-mail) jcamins at cpbibliography.com
> (web) http://www.cpbibliography.com/
> _______________________________________________
> 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