At 8:43 PM -0600 2000-01-17, harlan@stripped wrote:
>Hi,
>
>MySQL is supposed to allow a date to be specified with single-digit
>months and days if the numbers are less than ten, but does not:
>
>bug.sql:
>-----------------------------------------------------------------
>create table bug
>(
> dt date
>);
>
>insert into bug (dt) values ('2000-1-1');
>insert into bug (dt) values ('2000-1-2');
>insert into bug (dt) values ('2000-1-3');
>
>select count(*) from bug where dt between '2000-1-01' and '2000-1-03';
>select count(*) from bug where dt between '2000-01-01' and '2000-01-03';
>-----------------------------------------------------------------
>
>output:
>-----------------------------------------------------------------
>count(*)
>0
>count(*)
>3
>-----------------------------------------------------------------
This is due to the implementation of BETWEEN. Try using
WHERE dt >= mindate AND dt <= maxdate.
--
Paul DuBois, paul@stripped