I want the Codeigniter equivalent of the sql below:
select * from `table_name` where DATE_FORMAT('table_name', "%Y-%m") < "YYYY-MM"
I have tried it but get NULL as the answer.Here is how i did it
$this->db->select_sum('column_name')->from('table_name')->where("DATE_FORMAT('column_name','%Y-%m') <","YYYY-MM")->get();
Thnx for any help?