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

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -