Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2011-01-17 : 09:33:04
|
I have a column with the following expression(ISNULL(STATUS_DATE) && ISNULL(FEEPAYER) && FEEPAYER == "N" && FEEPAYER == " ") && (FEEPAYER == "Y") ? 0 : 1But it is not returning the desired results. i want to return 0 ifStatus_Data is NULL, Feepayer is NULL, Feepayer = N, FEEPAYER is emptyI want to return 1 ifFEEPAYER = Ycan someone tell me where i am going wrong pleaseMCTS / MCITP certified |
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2011-01-17 : 11:44:21
|
Does anyone know where i can get some good examples on the web? |
|
|
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2011-01-18 : 06:46:05
|
Can anyone help at all? |
|
|
Stamey
Starting Member
14 Posts |
Posted - 2011-02-01 : 13:54:16
|
This is about as close as I can get to your requirements. I used 3 variables in a package and the Expression Builder. The variables were called FeePayer, Status, and Test, with Test having the expression in it.IsNull(@[User::Status]) ==True?"0": IsNull( @[User::FeePayer]) ==True? "0": @[User::FeePayer] == "N"? "0": @[User::FeePayer] == "Y"? "1": "0"It evaluates correctly if Status is "Y", then evaluates if FeePayer Is Null, and if not, if it = "N", and if not, if it = "Y", and returns a "1" if it does, otherwise it returns a "0".I was unable to evaluate the Null and "Empty" in the scope of variables.Chris |
|
|
|
|
|
|
|