运行此查询时出现错误:
SELECT '06/30/' +
CASE WHEN GETDATE() BETWEEN Cast('1/01/' + YEAR(GETDATE()) + ' 12:01:01' As DateTime) And Cast('6/30/' + YEAR(GETDATE()) + ' 12:01:01' as DateTime)
THEN CAST(
YEAR(DATEADD(YY, 2, GETDATE())) AS VARCHAR(4))
WHEN GETDATE() BETWEEN Cast('7/01/' + YEAR(GETDATE()) + ' 12:01:01' As DateTime) And Cast('12/31/' + YEAR(GETDATE()) + ' 12:01:01' as DateTime)
THEN CAST(
YEAR(DATEADD(YY, 3, GETDATE())) AS VARCHAR(4))
END
AS DateEnding FOR XML RAW
Conversion failed when converting the varchar value '1/01/' to data type int.