我需要有关日期和特定时间范围之间查询的帮助。例如,用户在该日期从晚上 7 点1 Jan 2019
到晚上10 点进入大楼。1 April 2019
数据库将 EVENTDATE 存储为 01.01.2019, 07:15:01.000
我每天都尝试过并且有效
SELECT *
FROM event
WHERE eventdate BETWEEN '01.01.2019, 19:00:00' AND '01.01.2019, 22:00:00'
按日期范围尝试但无效
SELECT *
FROM event
WHERE eventdate BETWEEN '01.01.2019' AND '01.02.2019'
AND eventdate BETWEEN '19:00:00.000' AND '22:00:00.000'