title: SQL search between 2 dates in SQL
body: <p>I've got a database that needs to display records between 2 dates.</p>
  <p>At the moment I've got a form with 2 text boxes on - one for <code>datefrom</code> and one for <code>dateto</code>.</p>
  <p>My plan was to format and store the values from these text boxes as global variables</p>
  <pre><code>DateFrom = Format(Me.DateFrom, &quot;yyyy/mm/dd&quot;)
  DateTo = Format(Me.DateTo, &quot;yyyy/mm/dd&quot;)
  </code></pre>
  <p>that I cam then pass into a passthrough query with this criteria for  field called dateCollected</p>
  <pre><code>HAVING (((Collections.DateCollected) str_to_date(datefrom, ‘%y/%m/%d’) and str_to_date(dateto, ‘%y/%m/%d’)) AND ((dbo.udfRawHazPropsList([ConsignmentNoteNumber],[ewc_code])) Is Not Null))
  </code></pre>
  <p>However, no matter what I try I can't get this to work. Any ideas as to a solution would be much appreciated!</p>