List:General Discussion« Previous MessageNext Message »
From:Vivek Khera Date:June 29 1999 5:39pm
Subject:Re: BETWEEN fails for Timestamps
View as plain text  
>>>>> "JM" == Jon Mitchell <jonm@stripped> writes:

mysql> select * from Requests where '19990519' <= When and When <= '19990521';

JM> Which extracts about a dozen records (not reproduced). However
JM> I'd prefer to use:

mysql> select * from Requests where When between '19990519' and '19990521';

JM> This just returns an empty set, whereas I expect it to produce
JM> the same dozen records

Is there any particular reason you are making your timestamp 1990519
and 19990521 strings rather than leaving them as integers?

Also, your comparison of a TIMESTAMP column against <= 19990521 will
expand your value to 199905210000 which is probably not what you
expect;  I'd recommend specifying the exact time rather than just a
date.
Thread
BETWEEN fails for TimestampsJon Mitchell29 Jun
  • Re: BETWEEN fails for TimestampsVivek Khera29 Jun
  • BETWEEN fails for TimestampsMichael Widenius29 Jun