Plz help me to rectify the error:
Error: Incorrect syntax near the keyword 'As'.
Code:
declare @flag as int;
SET @flag='1';
SELECT Ci.iInstNumber AS InstNo,Ci.dInstDate AS InstDate, CASE WHEN (@flag='1')THEN SUM(Ci.fInstAmount+Ci.fShareProfit) ELSE Ci.fInstAmount As InstAmount END
Incorrect Yntax near AS
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Shivanand ArurRank #920 · 2.3K reputationPosted Nov 9, 2012, 12:13 AM EST
Code:
declare @flag int;
SET @flag='1';
SELECT Ci.iInstNumber AS InstNo,Ci.dInstDate AS InstDate, CASE WHEN (@flag='1')THEN SUM(Ci.fInstAmount+Ci.fShareProfit) ELSE Ci.fInstAmount As InstAmount END
Anil please mark the answer as accepted, if it helped!!!
Thank you.