title: SQL datetime compare
body: <p>I want to get some values from my table an there are some conditions about its datetime columns. </p>
  
  <p>I want to get all hotel values of a stated city from my table, which is named "LocalHotels". Also I should declare two <code>DateTime</code>values. First value should be less than or equal to hotel's value in <em>"start"</em> column, which is <code>datetime</code> data type. Second value should be greater than or equal to hotel's value in <em>"deadline"</em> column, which is <code>datetime</code> data type, either. </p>
  
  <p>All <code>datetime</code> values in these two columns are inserted in German <code>CultureInfo</code> format.</p>
  
  <p>When I stated query below, there are no problems;</p>
  
  <pre><code>string query = "SELECT * FROM LocalHotels WHERE city='LONDON' AND start &lt;='5.12.2015 00:00:00' AND deadline &gt;='8.12.2015 00:00:00' ORDER BY city";
  </code></pre>
  
  <p>However when I changed day value of <code>DateTime</code> values from one digit to two digits, as I stated in below;</p>
  
  <pre><code>string query "SELECT * FROM LocalHotels WHERE city='LONDON' AND start &lt;='15.12.2015 00:00:00' AND deadline &gt;='18.12.2015 00:00:00' ORDER BY city"
  </code></pre>
  
  <p>I got an SQLException which indicates; </p>
  
  <blockquote>
    <p>The conversion of a varchar data type to a datetime data type resulted
    in an out-of-range value.</p>
  </blockquote>