Below is my mysql table:
-------------------------- ID Date_From Date_To -------------------------- 1 2011-02-01 2011-02-28 2 2012-09-01 2012-09-30
In id 6 the from date is 2013-01-01 and it fails in 2013-01-01 as the month is 01 which is less than 10. As you have mentioned all and condition so any false will not include that record.
2013-01-01