看起来您想要这个,因为您CASE
的原始表达式中有两个表达式:
SELECT dbo.COL_TBL_WAGES.[Job Group],
SUM(CASE
WHEN COL_V_COST.EMP_TNG_RL_CD = 'ST'
THEN [CountOfEMP_TNG_STT_DT]
ELSE 0 END
* CASE
WHEN IsNumeric([TBL_VCOURSE.Length]) = 1
THEN TBL_VCOURSE
ELSE 0 END
) AS ST_Hours
编辑,根据您的评论,您的查询将与此类似:
SELECT dbo.COL_TBL_WAGES.[Job Group],
SUM(CASE
WHEN COL_V_COST.EMP_TNG_RL_CD = 'ST'
THEN [CountOfEMP_TNG_STT_DT] ELSE 0 END
* CASE
WHEN IsNumeric([COL_TBL_VCOURSE].[Length]) = 1
THEN COL_TBL_VCOURSE.[LENGTH]
ELSE 0 END) AS ST_Hours,
SUM(CASE
WHEN COL_V_COST.EMP_TNG_RL_CD = 'ST'
THEN [CountOfEMP_TNG_STT_DT]*CAST([2011 Total] AS FLOAT) ELSE 0 END
* CASE
WHEN IsNumeric([COL_TBL_VCOURSE].[LENGTH]) = 1
THEN CAST([COL_TBL_VCOURSE].[LENGTH] AS FLOAT) ELSE 0 END) AS ST_Cost