[eluser]haydenp[/eluser]
Hi
I'm trying my best to stick to the Active Record approach but sometimes it puts up a bit of a fight! For instance ... has anyone tried to format a date as per below:
Code:
$this->db->select("table_name.id, DATE_FORMAT(table_name.x_date, '%d %b %Y') as y_date");
Trying my best to stick to the Active Record approach I have attempted a number of variations of the above code without success ...
Has anyone else managed to get this to work using the Active Record approach?
PS: The code above spews out
Code:
... DATE_FORMAT(table_name.x_date, `'%d` %b %Y') ...
and kicks up a 1064 You have an error in your SQL syntax ...
NOTE: As a "work-around" one can add 'FALSE' as a second parameter to the '$this->db->select' to stop CI from adding the back-ticks ... not ideal but it works!