problem with BETWEEN AND with dates
Posted: Mon Jan 02, 2006 1:13 pm
I have this query....
2005-12-26 till 2006-01-01 is actually a week period (from first day of week till last day including).
I want to catch every date for this period including 26.12 and 01.01
So I guess between should do that as is stated in:
.... only when I say 2006-01-02 I get the 01.01 dates also
Why is that? Do I misunderstand BETWEEN AND operators
Code: Select all
SELECT date AS pd
FROM registration
WHERE date
BETWEEN '2005-12-26' AND '2006-01-01'
ORDER BY pd2005-12-26 till 2006-01-01 is actually a week period (from first day of week till last day including).
I want to catch every date for this period including 26.12 and 01.01
So I guess between should do that as is stated in:
Unfortunatelly I get all dates till 31.12 (including) only.http://dev.mysql.com/doc/refman/4.1/en/ ... ators.html
If expr is greater than or equal to min and expr is less than or equal to max, BETWEEN returns 1, otherwise it returns 0. This is equivalent to the expression (min <= expr AND expr <= max)
.... only when I say 2006-01-02 I get the 01.01 dates also
Why is that? Do I misunderstand BETWEEN AND operators