I was trying to query a week of data that had a DateTime column. I used a where clause like this
WHERE [BEGIN_TIME] between CAST('2016-01-31 00:00' AS DATE) and CAST('2016-02-6 23:59' AS DATE)
WHERE [BEGIN_TIME] between '2016-01-31 00:00' and '2016-02-6 23:59'
and it would not return any rows for the 6th even though I knew there were 22 that should be returned.
I thought I had done something like this in the past. Shouldn't this have worked?
When I changed it to (notice I went to the 7th)
WHERE [BEGIN_TIME] between '2016-01-31' AND '2016-02-7'
The query returned rows for the 6th. All rows, whether on the 6th or on other dates do have a time component that is not 00:00:00. In other words they are all like 2016-02-01 08:30:00.000