Welcome Guest, Not a member yet? Register   Sign In
Active Record - Group by DATE_FORMAT()
#1

[eluser]nevsie[/eluser]
i am trying to run this query through active record, but it seems to be causing errors when outputted, or at least causes problems in the final SQL string produced:

Code:
$this->db->group_by("DATE_FORMAT(expdate, '%Y-%m')");

seems to output in the sql string:
Code:
GROUP BY DATE_FORMAT(expdate, `'%Y-%m')`

am i doing something obviously wrong here - or ar the quotes being converted or...
note the full query runs when i manually enter it including it as:
Code:
GROUP BY DATE_FORMAT(expdate, '%Y-%m')

any help or ideas appreciated. or is it maybe a bug or missing feature from CI's active record feature?




Theme © iAndrew 2016 - Forum software by © MyBB