I'm trying to make a query comparing only the year, I want to get all the posts on any given year
$posts = TPost::model()->findAllByAttributes(array('YEAR(date)'=>$year),array('order' => 'date desc', 'limit' => 4));
I typed in the year function in the query and Yii is giving this error
t_post" does not have a column named "YEAR(date)".
which is fine because , but how do I use the Year mysql function in the query using Yii?
Thanks