Converting Access Code to SQL

前端 未结 2 1146
鱼传尺愫
鱼传尺愫 2021-01-29 13:49

I have the following code in Access and I need it to work in sql, the Is numeric portion is throwing me off.

Sum([Employee Count]*IIf(IsNumeric([Length]),[Length         


        
2条回答
  •  暖寄归人
    2021-01-29 14:12

    You will replace the IIF() with a CASE expression. The IsNumeric() is valid in SQL Server:

    Sum([Employee Count]*
        case when IsNumeric([Length]) = 1
              then [Length]
              else 0 end) AS Total_hours,
    

提交回复
热议问题