List:General Discussion« Previous MessageNext Message »
From:Vivek Khera Date:June 1 1999 8:01pm
Subject:Re: Inclusive/Exclusive confusion for BETWEEN operator
View as plain text  
Is your field "submission" a date or a datetime value?  I suspect the
latter.

MySQL seems to make a datetime from '1999-05-31' be '1999-05-31
00:00:00' in all comparisons.  It seems to me that it would make more
sense to promote the date based on the direction of comparison.  For
example, when comparing < it should be treated as "1999-05-31
23:59:59" and when compared as > it should be the way it is currently.

You can work around this by properly specifying your BETWEEN to
compare the full datetime if your field is a datetime.


>>>>> "JM" == Jeff Magnusson <jeff@stripped> writes:

JM> I'm doing a select to get a monthly set of data, and it appears that if I do
JM> "date BETWEEN '1999-05-01' and '1999-05-31'" the data for the 31st isn't
JM> included.  Here's a clip where the only thing I change between selects is
JM> the upper limit on the BETWEN:

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@stripped       Rockville, MD       +1-301-545-6996
PGP & MIME spoken here            http://www.kciLink.com/home/khera/
Thread
Inclusive/Exclusive confusion for BETWEEN operatorJeff Magnusson1 Jun
  • Re: Inclusive/Exclusive confusion for BETWEEN operatorVivek Khera1 Jun
    • Re: Inclusive/Exclusive confusion for BETWEEN operatorunknown2 Jun
      • Re: Inclusive/Exclusive confusion for BETWEEN operatorChristian Mack2 Jun
    • RE: Inclusive/Exclusive confusion for BETWEEN operatorJeff Magnusson2 Jun
RE: Inclusive/Exclusive confusion for BETWEEN operatorFred Lindberg2 Jun