Hi!
I have AR with DATE field. How can i find records by year?
Hi!
I have AR with DATE field. How can i find records by year?
select * from orders where year(your_date) between 2010 and 2011
$results = Sales::model()->findAllBySql('select * from tbl_sales s where year(s.date) = 2011');
return $results;