title: CakePHP Search between 2 Date Records
body: <p>I am building a small Web App that lets users reserve Office Rooms and Equipment. For the Reservation they enter a Start and an End Date.</p>
  
  <p>When a user tries to find out if any (for example) car is available on 2012-10-23, and the database holds reservation date records of Start: <code>2012-10-20</code> and End: <code>2012-10-25</code> for (lets say) all the cars, how do I include all the dates between my date entries in the search?</p>
  
  <p>The <code>$date</code> variable gets it's value from the Date Search Form Field.</p>
  
  <p>This, unfortunately does not work, and I can't figure out how to use daysAsSql for this query:</p>
  
  <pre><code>$conditions = array(
      'conditions' =&gt; array(
          '? BETWEEN ? AND ?' =&gt; array($date,'Equipment.date_start','Equipment.date_end'), 
      )));
  
  $this-&gt;set('equipments', $this-&gt;Equipment-&gt;find('all', $conditions));
  </code></pre>