php - DATE_FORMAT in where condition of Codeigniter Active Record -
i want codeigniter equivalent of sql below:
select * `table_name` date_format('table_name', "%y-%m") < "yyyy-mm"
i have tried null answer.here how did it
$this->db->select_sum('column_name')->from('table_name')->where("date_format('column_name','%y-%m') <","yyyy-mm")->get();
thnx help?
use without quotes column_name
date_format(column_name,'%y-%m')
$this->db->select_sum('column_name') ->from('table_name') ->where("date_format(column_name,'%y-%m') <","yyyy-mm") ->get();
Comments
Post a Comment