我正在尝试获取两个日期之间的记录,但是当我运行 SQL 时,出现以下错误:
操作数类型冲突:datetime2 与 int 不兼容
SELECT M.Id, M.MTimeInt, M.Date, CAST(D.Name AS TEXT) as Name
FROM C
JOIN N ON C.N_Id=N.Id
JOIN M ON M.N_Id=N.Id
JOIN MDish ON MDish.M_Id=M.Id
JOIN D ON D.Id=MDish.D_Id
WHERE C.Id=110 AND M.Date BETWEEN 2012-05-28 AND 2012-06-08
SQL 看起来是正确的,但我似乎无法弄清楚它为什么抱怨,知道吗?
谢谢