Thanks,but I've also tried the date() function to compare only the date part of the column
like this select * where date(date_col) between date(startdate) and date(enddate) and the result is the same. On Thu, 2004-09-23 at 11:04, gerald_clark wrote: > 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]