title: DATEDIFF IN ACTIVE RECORD IN CODEIGNITER
body: <p>I use active record for get some record, and I use datediff fuction for get difference between two dates. This is the active record</p>
  
  <pre><code>$this-&gt;db-&gt;select('a.ID, a.PREFIX,
                     a.SERIAL_NUMBER, a.EOR_NUMBER,
                     a.IN_DATE, a.OUT_DATE, 
                     DATEDIFF(OUT_DATE,IN_DATE ) + 1 AS TOTAL_DATE, a.BALANCE, a.REMARKS, a.NO_EOR');
  $this-&gt;db-&gt;from($this-&gt;table . ' as a');
  </code></pre>
  
  <p>But the query was produced like this :</p>
  
  <pre><code>SELECT `a`.`ID`, 
     `a`.`PREFIX`, `a`.`SERIAL_NUMBER`, 
     `a`.`EOR_NUMBER`, `a`.`IN_DATE`, 
     `a`.`OUT_DATE`, DATEDIFF(OUT_DATE, `IN_DATE ) + 1` AS `TOTAL_DATE`, 
     `a`.`BALANCE`, `a`.`REMARKS`, 
     `a`.`NO_EOR` FROM 
  `tb_fin_storage` as `a`
  </code></pre>
  
  <p>query was wrong in <strong>DATEDIFF(OUT_DATE, <code>IN_DATE ) + 1</code> AS <code>TOTAL_DATE</code></strong>, and I can see that the backthick was produced by AR is wrong. Any solution is so appreciated.</p>