date_format merely changes the way a date is output, you want to use date_sub.
Here is the solution straight from the MySQL manual:
Code:
Here is an example that uses date functions.
The following query selects all records with a date_col value
from within the last 30 days:
mysql> SELECT something FROM tbl_name
-> WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= date_col;