title: How to use addFieldToFilter on a custom collection
body: <p>I was wondering if it's possible to filter a custom collection in <strong>Magento 1.7.2.</strong>
  My current code looks like this:</p>
  
  <pre><code>$collection = $model-&gt;getCollection()
     -&gt;addFieldToFilter('gc_id',array('gt' =&gt; 0))
     -&gt;addFieldToFilter('expiration_date', array('lteq' =&gt; Mage::getModel('core/date')-&gt;gmtDate()));
  </code></pre>
  
  <p>I can print the query it generates and if I run it in MySQL I do get the right table rows. However, the collection that gets returned has no items in it. The collection without the filters also returns all the right items, so there are no issues with collection implementation. The collection class inherits from <code>Mage_Core_Model_Resource_Db_Collection_Abstract</code></p>
  
  <p>Query:</p>
  
  <pre><code>SELECT `main_table`.* FROM `st_freegiftcard` AS `main_table` WHERE (gc_id &gt; 0) AND (expiration_date &lt;= '2013-11-15 23:59:20')
  </code></pre>
  
  <p>Current ugly workaround:</p>
  
  <pre><code>  foreach($collection as $free_gc){
          if($free_gc-&gt;getGcId() &gt; 0 
               &amp;&amp; $free_gc-&gt;getExpirationDate() &lt;= Mage::getModel('core/date')-&gt;gmtDate()){
             ...
          }
     }
  </code></pre>