List:General Discussion« Previous MessageNext Message »
From:Vivek Khera Date:May 25 1999 7:05pm
Subject:Re: Dates querying Mysql
View as plain text  
>>>>> "CMC" == Claudia M Castaneda <claudia@stripped>
> writes:

CMC> Well, it worked!!

CMC> Now, if you would be kind enough to explain us what is in a +0???


For the same reason that

 select obs_id, obs_URI, obs_source, beg_date, beg_time from
 observation where beg_date between '1999-01-20' and '1999-05-30';

will work.  The automagic type conversion from strings to numbers in
MySQL seems to fail in this instance when comparing a string type to
numbers with "BETWEEN".

By adding the +0, you explicitly converted the date to a number type.
In my example, I made the values for the BETWEEN into strings, which
are treated nicely as DATEs.

I don't know which is faster, though.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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
Dates querying MysqlClaudia M. Castaneda24 May
  • Re: Dates querying MysqlGraeme B. Davis25 May
  • Re: Dates querying MysqlChristian Mack25 May
    • Re: Dates querying MysqlClaudia M. Castaneda25 May
      • Re: Dates querying MysqlJim Faucette25 May
        • Re: Dates querying MysqlClaudia M. Castaneda25 May
          • Re: Dates querying MysqlVivek Khera25 May
        • Re: Dates querying MysqlJim Faucette25 May
          • Re: Dates querying MysqlMichael Widenius2 Jun
            • Re: Dates querying MysqlVivek Khera2 Jun
              • Re: Dates querying MysqlMichael Widenius3 Jun
Re: Dates querying MysqlVivek Khera2 Jun