anil john

anil john

  • NA
  • 156
  • 210.5k

Incorrect syntax near the keyword As

Nov 9 2012 4:50 AM
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

Answers (2)