The reason it returns nothing is because Doctrine escapes the expression - generated SQL
WHERE (date > 'DATE_SUB(CURDATE(), INTERVAL 7 DAY)')
but not
WHERE (l.action_time > DATE_SUB(CURDATE(), INTERVAL 7 DAY))
You can make it work as follows:
$date = new Doctrine_Expression('DATE_SUB(CURDATE() , INTERVAL 7 DAY)'); $q->where('date > ' . $date);
However, this is not the safest option, since the input is not shielded and is not good practice ...
source share