Author |
Topic |
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2012-06-25 : 15:52:42
|
[code]Currently,I have below code in the derived column but i want to extend the below condition set the TED to 0 if it null or "No" and If it is "YES" then to 1.TED == "Yes" ? 1 : 0 When TED is null or '' then 0if "YES" = 1if "No" = 0[/code] |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2012-06-25 : 16:28:54
|
I did tried with below code in derived showing an error.Please let me know what i missing..CASE WHEN TED ="Yes" THEN 1WHEN TED ="No" THEN 0WHEN TED = "" THEN 0WHEN TED is null THEN 0ELSE TED END |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2012-06-25 : 16:54:29
|
I did updated with mentioned changes it is still showing the error.. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2012-06-25 : 17:06:28
|
CASE WHEN TED ='Yes' THEN 1WHEN TED ='No' THEN 0WHEN TED = '' THEN 0WHEN TED is null THEN 0ELSE TED END |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2012-06-26 : 11:45:19
|
Why conversion is required and does i need to use case statement to accomplish the desired results... |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2012-06-26 : 12:45:36
|
Thanks for your help..I was able to resolve the issue without any errors. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|