sql中关于case。。。when CASE (CONVERT(INT,RIGHT(DATEPART(YEAR,GETDATE()),2)) -
LEFT(A1.UnifiedDate,2))*52 +DATEPART(WEEK,GETDATE()) - RIGHT(A1.UnifiedDate,2) AS Weeks
WHEN WEEKS >52 THEN ‘大於一年’
END
求正确写法 ------最佳解决方案-------------------- CASE
WHEN (CONVERT(INT,RIGHT(DATEPART(YEAR,GETDATE()),2)) -
LEFT(A1.UnifiedDate,2))*52 +DATEPART(WEEK,GETDATE()) - RIGHT(A1.UnifiedDate,2) >52 THEN ‘大於一年’
END ------其他解决方案-------------------- 不能代替,就那样写。 ------其他解决方案-------------------- 有好几个when 我想把WHEN (CONVERT(INT,RIGHT(DATEPART(YEAR,GETDATE()),2)) -
LEFT(A1.UnifiedDate,2))*52 +DATEPART(WEEK,GETDATE()) - RIGHT(A1.UnifiedDate,2) 用其他东西代替