title: In SQL Server, what is the best way to filter items for an entire day
body: <p>In SQL Server, I want to show all items for a particular day. What is the best way to do this: DATEPART, BETWEEN, OR >= + &lt; ? All 3 should work functionally, but are some of them better/worse for performance?</p>
  
  <p>1)</p>
  
  <pre><code>SELECT *
  FROM BlogPosts
  WHERE DATEPART(yyyy,BlogPostDate) = 2011
      AND DATEPART(m,BlogPostDate) = 5
      AND DATEPART(d,BlogPostDate) = 7
  </code></pre>
  
  <p>2)  </p>
  
  <pre><code>SELECT *
  FROM BlogPosts
  WHERE BlogPostDate BETWEEN '2011-05-07' AND '2011-05-07 23:59:59'
  </code></pre>
  
  <p>3)    </p>
  
  <pre><code>  SELECT *
      FROM BlogPosts
      WHERE BlogPostDate &gt;= '2011-05-07' 
          AND BlogPostDate &lt; '2011-05-08'
  </code></pre>