[Koha] Problem constructing a report - WHERE dates?

Beverly Church beverly.church at liblime.com
Fri Jul 10 06:13:16 NZST 2009


Another option is to use the "date" time function:

WHERE type= 'issue' AND date(datetime) BETWEEN '20091-06-01' AND
'2009-06-30'

This seems to work.


On Thu, Jul 9, 2009 at 1:33 PM, Nicole Engard <nicole.engard at liblime.com>wrote:

> You are right, you want to make it '2009-07-01' if you want the entire
> month of June. Also a tip - you can do this :
>
> WHERE type= 'issue' AND datetime BETWEEN '20091-06-01' AND '2009-07-01'
>
> For examples of reports you might want to check out this page:
> http://wiki.koha.org/doku.php?id=sql_library
>
> ---
>
> Nicole C. Engard
> Open Source Evangelist, LibLime
> (888) Koha ILS (564-2457) ext. 714
> nce at liblime.com
> AIM/Y!/Skype: nengard
>
> http://liblime.com
> http://blogs.liblime.com/open-sesame/
>
>
>
> On Thu, Jul 9, 2009 at 1:30 PM, Greg Barniskis<gregb at scls.lib.wi.us>
> wrote:
> >
> > WHERE type= 'issue' AND datetime > '2009-06-01' AND datetime <
> '2009-06-30'
> >
> > Is that right? Keeping in mind that I'm no Koha expert, much less expert
> > in MySQL, I could easily be wrong. But in more general db work, I was
> > always taught that a bare date stamp equated to a time stamp of midnight
> > (the start of that date).
> >
> > Thus a WHERE clause of "less than date" would technically exclude
> > anything that was actually on that date. I was told to use
> >
> > < '2009-07-01'
> >
> > if I wanted to include everything up to '2009-06-30 23:59:59'.
> >
> > Right? Wrong? Conditional?
> >
> > --
> > Greg Barniskis, Computer Systems Integrator
> > South Central Library System (SCLS)
> > Library Interchange Network (LINK)
> > <gregb at scls.lib.wi.us>, (608) 266-6348
> > _______________________________________________
> > 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
>



-- 
-----------------
Beverly Church
Project Manager - LibLime
phone: 1.888.564.2457 x717
email: beverly.church at liblime.com
skype: beverlychurch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.katipo.co.nz/pipermail/koha/attachments/20090709/eeda5d55/attachment.htm 


More information about the Koha mailing list