mysql> select count(*) from access_log where to_days(when)=to_days(now())-2; +--------------+ | count(*) | +--------------+ | 1250 | +--------------+ 1 row in set (0.10 sec)