title: How can I select with a datetime WHERE clause in SQL Server?
body: <p>If I need to select just less than datetime, I do something like this:</p>
  
  <pre><code>  SELECT StackerReplacedEventID, Occured 
    FROM StackerReplacedEvent 
    WHERE Occured&lt;CONVERT(DATETIME, 'Jul 11 2011 03:50PM', 120)
  </code></pre>
  
  <p>but I get an error.  I've also tried this way:</p>
  
  <pre><code>WHERE Occured&lt;'Jul 11 2011 03:50PM'
  </code></pre>