SQL Server 2005:
Next view
SELECT CONVERT(VARCHAR(20), keyedtimestamp, 101) as KeyedDate FROM TMSSTATFILE_STATS a WHERE (CONVERT(VARCHAR(20), a.KeyedTimestamp, 101) BETWEEN '03/01/2011' And '03/31/2011') ORDER BY KeyedDate
Results are shown for key dates from 3/2/2011 to 3/31/2011.
If I change the first date to 03/00/2011
SELECT CONVERT(VARCHAR(20), keyedtimestamp, 101) as KeyedDate FROM TMSSTATFILE_STATS a WHERE (CONVERT(VARCHAR(20), a.KeyedTimestamp, 101) BETWEEN '03/00/2011' And '03/31/2011') ORDER BY KeyedDate
now it gives data for dates from 3/1/2011 to 3/31/2011
The KeyedTimestamp field is a DateTime, and there is time with these entries. All entries for 3/31/2011 taken into account. I know that I can do this instead by setting the maximum time on the second date between them, so I am not looking for an alternative where where, but rather understand why he ignores entries from the first, even if his inclusion is from the 31st.
It’s almost as if he were checking on 3/1/2011 23:59:59, I was hoping that I could eliminate this kind of check, where I only care about the date, not the time
source share