title: VBA variable in SQL date query
body: <p>I'm trying to query the SQL database for all lines where the date is after a date given through user input. I've run into a variety of errors from "incorrect syntax near" when I surround my date with "#" to "arithmetic overflow error converting expression to". My current code looks like this:</p>
  
  <pre><code>inputdate = InputBox("Please enter the starting date (mm/dd/yyyy)")
  Debug.Print inputdate
  
  querydate = "(DTG &gt; " &amp; Format(inputdate, "MMDDYYYY") &amp; ")"
  
  select StationID, DTG, CeilingFeet from SurfaceOb where " &amp; querydate &amp; " and StationID = 'NZWD'"
  </code></pre>
  
  <p>DTG is the column name for the date-time group in the SQL database. Any idea where I am going wrong? I've tried every solution I could find over the past few days without luck. Thank you in advance.</p>