现在我正在开发一个程序,但是遇到了
的问题DATE类型不是已定义的系统类型。
我在本地使用SQL Server 2008编写了我的查询并运行得很好,但是当更改为实时服务器时,它出错并提示错误。对于我的公司使用SQL Server 2000的实时服务器。
以下是我的询问:
SELECT DISTINCT
CONVERT(varchar, A.MONTH) + '/' + CONVERT(varchar, A.YEAR) AS MonthYear
FROM
XXX1 AS A
LEFT JOIN
XXX2 AS B ON A.EMPLOYEE_NO = B.EMPLOYEE_NO
LEFT JOIN
XXX3 AS C ON A.EMPLOYEE_NO = C.EMPLOYEE_NO
LEFT JOIN
XXX4 AS D on A.FREQUENCY = D.FREQUENCY
WHERE
(A.EMPLOYEE_NO = '710049') AND (A.FREQUENCY = '9')
AND ((day(getdate()) >= DAY(d.TRANS_DATE) OR
month(getdate()) = MONTH(d.TRANS_DATE) OR
YEAR(getdate()) = YEAR(d.TRANS_DATE))
OR (month(getdate()) - MONTH(d.TRANS_DATE) <> 0
OR day(getdate()) < DAY(d.TRANS_DATE)))
任何解决方案?