我正在使用我的日期(字符串)与数据库表列Date(varchar)进行比较。它正在工作,但仅比较日期忽略了月份和年份,如。
SELECT * from Report
SELECT * from Report WHERE Date BETWEEN '05-03-2019' AND '07-03-2019'
SELECT * FROM Report WHERE CAST(Date as DATE) BETWEEN CAST('05-02-2019'
AS DATE) AND CAST('07-02-2019' AS DATE);