title: How does one query a DateTimeOffset column to get all rows for a particular day?
body: <p>So let's say you have a table with the column below (type is datetimeoffset(3)).</p>
  
  <pre><code>    DTO_Created
      2017-04-28 03:16:56.942 -05:00
      2017-05-01 00:20:54.925 -05:00
      2017-05-01 12:17:52.752 -05:00
      2017-05-01 23:21:00.198 -05:00
      2017-05-02 01:19:23.254 -05:00
  </code></pre>
  
  <p>How would you query to only get the rows created on 2017-05-01? (3 rows total)  I am attempting this, but am not getting all 3.</p>
  
  <pre><code>SELECT * FROM MyTable WHERE DTO_Created &gt;= '2017-05-01 00:00:00.000' AND DTO_Created &lt;= '2017-05-01 23:59:59.999'
  </code></pre>
  
  <p>The problem seems to be caused by the type (datetimeoffset) because this doesn't happen with regular datetime columns.</p>
  
  <hr>
  
  <p>Environment: SQL Server 2016</p>