title: Excel VBA SQL Query to Access to return records between dates
body: <p>Morning all,</p>
  
  <p>I am hoping this is a quick one. I have a query in Excel that requests records between two date points. It returns without errors but also returns unexpected values, seemingly because the date has been swapped around. I am working with the UK date format (dd/mm/yyy). </p>
  
  <p>I have tried passing the date as a date type and a string type, as a datevalue and just the text. I have also tried passing it as yyyymmdd.</p>
  
  <p>In the below example sFromDate is 06/04/2016 (6th April) and sToDate is 12/04/16 (12th April). Dates between June and December are being returned.</p>
  
  <pre><code>sSelectedArea = "ThisTMRacf"
  sFromDate = DateValue(Sht_SpecificView.Range("D5"))
  sToDate = DateValue(Sht_SpecificView.Range("F5"))
  
  Set rex = db.OpenRecordset("SELECT eGain.RecordDate FROM [eGain], [Staff] 
  WHERE eGain.Racf = Staff.Racf AND (Staff.TeamManager = '" &amp; sSelectedArea &amp; "' 
  OR Staff.CSM = '" &amp; sSelectedArea &amp; "') 
  AND eGain.RecordDate BETWEEN #" &amp; sFromDate &amp; "# AND #" &amp; sToDate &amp; "# ;")
  </code></pre>
  
  <p>Is there another way to pass the date so that it doesn't convert?</p>