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.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Derived Column Help

Author  Topic 

jscot
Posting Yak Master

106 Posts

Posted - 2011-01-14 : 22:21:39

I want to know where i am wrong
Here is my source filed data
Y
N
EMPTY
UN DECIDED

Note:- Requirement is if the field has Y convert to 'YES', N convert to 'NO', Empty convert to 'Pending' and Un Decided should be as it as

I am using Derived Column and below are function that i am using

([Table1] == "Y" ? "YES" : ([Table1] == "N" ? "NO" [Table1] == " " ? "PENDING" :"")))

and i map this field to my target field

RESULT SHOULD BE:-
YES
NO
PENDING
UN DECIDED

But I am getting this Result
YES
NO
EMPTY
EMPTY

I want to where I am wrong. Thanks for help.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-01-16 : 06:25:19
are you sure its empty and not any unprintable character?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

jscot
Posting Yak Master

106 Posts

Posted - 2011-01-19 : 00:23:43
yes that for sure there is empty no values
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-01-24 : 11:45:50
try:-

([Table1] == "Y" ? "YES" : ([Table1] == "N" ? "NO" : ([Table1] == " " ? "PENDING" : [Table1])))

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -