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