I have a select query that retrieves all entries that are 3 weeks old.
I want to know if there is an expression like where date> Expr (CURDATE () - 3 WEEKS) or if I must first make calculations of differences in my php script.
The format of my date is a timestamp like that : 2010-06-21 16:59:59
Sincerely,
You can use the
DATEDIFF()function like so:WHERE DATEDIFF(CURDATE(), date) = 21.