multiple if else in expression property of a variable
i have two variables , based on the variable values i need to write an expression which will bring out result like below, can some one share their expression plssss.i need to write the below if statement in an expression DECLARE @headerCount INT , @LoanCount INT SET @headerCount = 1 SET @LoanCount = 56000 IF (@headerCount <> 1 AND @LoanCount > 32000) BEGIN IF (@headerCount > 1 AND @LoanCount > 32000) PRINT('has more than 1 headers and loan count excess') ELSE PRINT('has no header and loan count excess') END ELSE BEGIN IF (@headerCount <> 1) BEGIN IF (@headerCount > 1) PRINT ('has more than 1 header') ELSE PRINT ('has 0 headers') END IF (@loancount > 32000) PRINT ('LoanCount excess') END
November 30th, 2011 1:29pm

Try using below expression: (@[User::headerCount] != 1 && @[User::loanCount] > 32000) ? (@[User::headerCount] > 1 ? "has more than 1 headers and loan count excess" : "has no header and loan count excess" ) : ( (@[User::headerCount] != 1 ? ( @[User::headerCount] > 1 ? "has more than 1 header" : "has 0 headers" ) : "") + ( @[User::loanCount] > 32000 ? "LoanCount excess" : ""))
Free Windows Admin Tool Kit Click here and download it now
November 30th, 2011 3:19pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics