SyntaxFix
Write A Post
Hire A Developer
Questions
DECLARE @JCnt int=null SEt @JCnt=(SELECT COUNT( ISNUll(EmpCode,0)) FROM tbl_Employees WHERE EmpCode=1 ) UPDATE #TempCode SET janCA= CASE WHEN @JCnt>0 THEN (SELECT SUM (ISNUll(Amount,0)) FROM tbl_Salary WHERE Code=1 )ELSE 0 END WHERE code=1