title: Formatting using FormatDateTime for running SQL Query in MS Access
body: <p>I have dates in <code>TakeDate</code> Field (Data type : Date ) in a table of MS Access.
  I have a text Box <code>txtGdateTo</code> in a search form with <code>Format</code> set to <code>Short Date</code></p>
  <blockquote>
  <p>When I run SQL queries like as below, I don't get desired data filtered.</p>
  </blockquote>
  <pre><code>Select * from tblWork WHERE TakeDate &lt;= Me.txtGdateTo
  </code></pre>
  <p>Hence I tried the below SQL, but it does not work too.</p>
  <pre><code>Select * from tblWork WHERE TakeDate &lt;= Format(Me.txtGdateTo, &quot;\#mm\/dd\/yyyy\#&quot;)
  </code></pre>
  <p>I added another filed to the table <code>TakeDate0</code> with function</p>
  <p><code>TakeDate0: FormatDateTime([TakeDate],&quot;\#mm/dd/yyyy\#&quot;)</code></p>
  <p>This gives me value as <code>#error</code>.</p>
  <blockquote>
  <p>Q : Is there any best way to manage these errors using date field?</p>
  <p>Q : What formatting needs to be done and is there a need for the additional column?</p>
  </blockquote>
  <p>In my case, the users will enter data in the table in the format dd/mm/yyyy</p>