DECLARE @i varchar(13)
DECLARE @Year varchar(30)
SET @i = 2
SET @Year = 2013
SELECT SUM(CAST([totalAfterMultiplier] as money)) as 'totalAfterMultiplier' FROM [postfinanceAfterMultiplier]
WHERE CAST([ORDER] as date) >= '01/'+@i+'/'+ @Year +'' AND CAST([ORDER] as date) <= '31/'+@i+'/'+ @Year +''
我收到此错误:从字符串转换日期和/或时间时转换失败。
数据库中的所有值都是varchar(50)
我查看了其他帖子,但似乎无法正常工作
感谢大家的帮助