Hi All, I would like to run a raw sql query, as I don't see how to do this with Doctrine natively ( I want to find birthdays in the next 14 days). I have tried the following code:
$sql="SELECT s.* FROM Staff AS s WHERE floor(EXTRACT(EPOCH FROM age(current_date + interval '14 days',birthdate )::INTERVAL)/ 31557600)::integer - floor(EXTRACT(EPOCH FROM age(current_date,birthdate )::INTERVAL)/31557600)::integer <>0;"; $query = new Doctrine_RawSql(); $query->parseDqlQuery($sql); $query->addComponent('S', 'Staff'); $query->execute(); It does not work :( and throws out: Fatal error: Call to a member function getFieldName() on a non-object in XXXX/lib/vendor/symfony/lib/ plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/ Graph.php on line 295 I am using symfony 1.4, and the SQL works correctly when executed directly in Postgresql. Any help would be much appreciated. Robert -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en