title: How to get all orders over period by a collection in Magento?
body: <p>I need to retrieve a collection of all orders taken over a period of time. </p>
  
  <p>Also I need to query the number of orders per day taken. </p>
  
  <p>Here is what I have tried: </p>
  
  <pre><code>$fromDate = '2016-01-15 00:00:00';
      $toDate = '2016-02-15 00:00:00';
  
      $orders = Mage::getModel('sales/order')-&gt;getCollection()
          -&gt;addAttributeToSelect('created_at')
          -&gt;addAttributeToFilter('created_at', array('from'=&gt;$fromDate, 'to'=&gt;$toDate));
  
      $orders-&gt;getSelect()
          -&gt;columns('COUNT(created_at)')
          -&gt;group('created_at');
  </code></pre>