日期再某个范围内:between 日期 and 日期
例如:date between '2020-02-05' and '2020-02-06'
相当于 date >='2020-02-05 00:00:00.000' and date <='2020-02-06 00:00:00.000'
所以如果日期有时分秒的,请加上时分秒00:00:00.00 23:59:59.998
date between '2020-02-05 00:00:00.00' and '2020-02-06 23:59:59.998'
相当于 date >='2020-02-05 00:00:00.000' and date <='2020-02-06 23:59:59.998'
这样子才是某个日期范围内,注意这里23:59:59.998,经过测试,
sql server 2020-02-06 23:59:59.999 等于2020-02-07 00:00:00.000,很特别!!!!