1

My current expression any help would be great thank you!

TRIM(Unit) == "N/A" ? (DT_STR,255,1252)NULL(DT_STR,255,1252) : 
TRIM(Unit) == "" ? (DT_STR,255,1252)NULL(DT_STR,255,1252) :  [Unit]

it will add null to empty values however how do i trim it?

For exmaple if the value is empty then it will add a null, but if the value is space HGDS it will not trim it.

The solution as below

 TRIM(Unit) == "N/A" ? (DT_STR,255,1252)NULL(DT_STR,255,1252) : 
 TRIM(Unit) == "" ? (DT_STR,255,1252)NULL(DT_STR,255,1252) :  TRIM([Unit])
5
  • Please post your solution - just to help other folks with a similar issue. Jan 9, 2013 at 19:40
  • You should post the solution as an answer and then accept it.
    – Taryn
    Jan 9, 2013 at 19:40
  • 2
    TRIM(Unit) == "N/A" ? (DT_STR,255,1252)NULL(DT_STR,255,1252) : TRIM(Unit) == "" ? (DT_STR,255,1252)NULL(DT_STR,255,1252) : TRIM([Unit])
    – Neo
    Jan 9, 2013 at 19:40
  • If you solved it, add your solution as an answer, which you will be able to accept in a couple of days
    – talonmies
    Jan 9, 2013 at 19:40
  • 5
    @neo Post it below as a proper answer. As noted, you can accept your own answer after a few days. It will help future readers as well as OCD people like me who see 0 answer SSIS questions and have to click on them.
    – billinkc
    Jan 9, 2013 at 19:51

1 Answer 1

0

Just re-posting the answer by @Neo in the comments... So that people don't overlook the question thinking that it was unanswered.

TRIM(Unit) == "N/A" ? (DT_STR,255,1252)NULL(DT_STR,255,1252) : TRIM(Unit) == "" ? (DT_STR,255,1252)NULL(DT_STR,255,1252) : TRIM([Unit])

NOTE : @Neo : Feel free to delete my answer and Re-post your answer when ever you see this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.