title: Convert sql query in query in Active Record in codeigniter
body: <p>I need to convert this query in an active Record query.</p>
  
  <pre><code>SELECT * FROM test WHERE CAST(date AS DATE) = '2017-06-19' AND `ip` = '::1'
  </code></pre>
  
  <p>this is what I tried but the <code>where</code> with the <code>date</code> does not work</p>
  
  <pre><code> function search($date, $ip){
     $this-&gt;db-&gt;select('cast(date as Date)');
     $this-&gt;db-&gt;where('date', $date);
     $this-&gt;db-&gt;where('ip', $ip);
     return $this-&gt;db-&gt;get('visitas'); 
    }
  </code></pre>
  
  <p>this produce something like this</p>
  
  <pre><code>SELECT cast(fecha as Date) FROM (`visitas`) WHERE `ip` = '::1'
  </code></pre>
  
  <p>thank´s in advance.</p>