ケース式でエラーが発生します。1つの条件を評価して、適切なステートメントを返したいだけです。しかし、「as」の近くで構文エラーが発生し続けます。
これが私が持っているものです:
left outer join (
SELECT wbs1, wbs2, wbs3
, case
when (ProgramAffiliation = magrann.[programAffiliation_AEP/COHesh2010]())
then '[AEP] as ''AEP1'''
else [AEP Base] as 'AEP1'
end
, [AEP:Non-Compliant Mechanical Ventilation] as 'AEP2'
, [AEP - Non Energy Star AC ($90 deduction)] as 'AEP3'
, [AEP: Bonus] as 'AEP4'