Mauricio Pellegrini wrote:

Hi,
I'm using Between to fetch rows whose date column is between two dates.


The thing is, sometimes it brings all the rows including those with a
date similar to the upper limit ( which is the correct behaviour,
according to the manual)


and in other cases it brings al the rows excluding those equal to the
upper limit (this shouldn't happen)

this is how I use it

  select * where date_col between startdate and enddate

beeing startdate my lower limit and enddate the upper limit

I'm using mysql 4.1.4 gamma but the same happened with 4.1.0 alpha

the date columns are datetime type.

First I would like to know why is this happening,
and second how to avoid it.

This is happening because you are trying to find a 14 digit number between 2 8 digit numbers.
Your datetime is 14 digits. Dates are only 8.



Thanks Mauricio









-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to