Why does mysql treat "<" like it was "<="? I've tried the following command:

SELECT * FROM `mi_schedule` WHERE `day`&lt;=(DATE_ADD(NOW(),INTERVAL 7 DAY)) AND `day`&gt;=NOW()


Got 8 rows. Then I changed the &lt;= to &lt;, and nothing changed, still 8 rows.

So I changed the interval from 7 to 6:

SELECT * FROM `mi_schedule` WHERE `day`&lt;(DATE_ADD(NOW(),INTERVAL 6 DAY)) AND `day`&gt;=NOW()


and I got one less row from the results (7 total), as expected.

I switched back from &lt; to &lt;=, and again nothing changed.

I.e. apparently the &lt; is considered to be a &lt;= instead.

Is that intentional? According to the docs, it shouldn't.

PS: day is a DATE type.

(using version 5.5.29, engine InnoDB)
Are you working with datetimes?

Notice that If I ran it now I'd get for instance:

August, 28 2014 13:57:36+0000


Which means that if my dates are at midnight I'd get the same with &lt; and &lt;=

You should probably cast this into DATE if you are to work with dates