尝试将此SQL语句从Microsoft访问转换为SQL Server。我知道SQL Server不使用Ccur而是使用CONVERT吗?
SELECT
Ccur(Choose(IIF(IsNull(SCStatus),1
,IIF(SCStatus=0,1,2))
,IIF(IsNull(TaxTDThisEmt),0
,TaxTDThisEmt)
,IIF(IsNull(SCTaxYTD),0
,SCTaxYTD))) AS [Tax This Employment]
FROM EeBals
答案 0 :(得分:1)
这样的事情会让你接近:
SELECT
CAST(
(
CASE WHEN ISNULL(SCStatus, 0) = 0 THEN ISNULL(TaxTDThisEmt, 0)
ELSE ISNULL(SCTaxYTD, 0)
END
) as money
) as [Tax This Employment]
FROM Table