title: Query by Date/Time in SQL Server 2005
body: <p>I have such a simple question, I feel stupid for asking it. I can't believe I'm hitting my head on this.</p>
  
  <p>I have a table called "Orders". "Orders" has a smalldatetime field called "DateOrdered". I need to get all of the "Orders" on a specific date. I have tried the following without any success:</p>
  
  <pre><code>SELECT * FROM Orders WHERE [DateOrdered]=2010-06-01
  
  SELECT * FROM Orders WHERE [DateOrdered]='2010-06-01'
  
  SELECT * FROM Orders WHERE [DateOrdered]=CAST('2010-06-01' AS smalldatetime)
  </code></pre>
  
  <p>What am I doing wrong? I can't believe I'm even asking this question. </p>