title: DateTime issue with vb and mdb
body: <p>I am working on an old software that uses a .mdb database.</p>
  
  <p>I have succeeded in setting up a connection to the database and i can run sql queries just fine when it comes to preprogrammed queries like this one :</p>
  
  <p><code>SELECT COUNT(*) AS test FROM shifts WHERE EmpId = '2' AND DateOpen &lt;= '3/28/2007'</code></p>
  
  <p>Moving on, i replaced the 2 with an expression depending on the user selection like so</p>
  
  <p><code>Employees(employe.SelectedIndex)</code> </p>
  
  <p>This worked fine too.</p>
  
  <p>Now, when i tried to replace the date with <code>startDate.Value.ToShortDateString</code> i started facing many conversion problems and i finally had something that worked so my where clause became like this :</p>
  
  <p><code>WHERE EmpId = '" &amp; Employees(employe.SelectedIndex) &amp; "' AND DateDiff('d', DateOpen, '" &amp; endDate.Value.ToShortDateString &amp; "') &lt;= 0</code></p>
  
  <p>Now i chose the same date that was in the query above, the query runs with no problems but surprisingly i got a null result, which doesn't make any sense to me because the query with the values already there returned a count of 2. </p>
  
  <p>I used some debugging output to make sure the query is properly being generated and i got the same query as above when i select the date.</p>
  
  <p>If you have any idea why this is not working or have any hints on the proper way to do it, i would appreciate all your input.</p>
  
  <p>Thanks in advance</p>