SolvedPrivate

Editing a Derived Column Transformation Expressions in SSIS  2008 r2 SSIS package

Posted on 2014-03-31
2
41 Views
Last Modified: 2016-02-10
Hi,
I have the following Derived Column Expression in a  Data Flow Transformation in an SSIS package
[MSTUB-xInt_Only-Rev-Dt] == "00000000" ? NULL(DT_WSTR,10) : SUBSTRING([MSTUB-xInt_Only-Rev-Dt],5,4) + "-" + SUBSTRING([MSTUB-xInt_Only-Rev-Dt],3,2) + "-" + SUBSTRING([MSTUB-xInt_Only-Rev-Dt],1,2)

Open in new window

This (I THINK)  replaces  values == "00000000" with NULLs
I now want to filter out “0 0 0 0” values also.
How do I amend the expression to accommodate this? Is it possible to add some kind of “OR”  to it?
Any guidance appreciated, thanks
0
Comment
Question by:blossompark
2 Comments
 
LVL 37

Accepted Solution

by:
ValentinoV earned 500 total points
ID: 39968545
Is it possible to add some kind of “OR”  to it?

That's indeed possible.  The OR in SSIS expressions is a double pipe: ||

So your expression would be something like this:

[MSTUB-xInt_Only-Rev-Dt] == "00000000" || [MSTUB-xInt_Only-Rev-Dt] == "0 0 0 0" ? NULL(DT_WSTR,10) : SUBSTRING([MSTUB-xInt_Only-Rev-Dt],5,4) + "-" + SUBSTRING([MSTUB-xInt_Only-Rev-Dt],3,2) + "-" + SUBSTRING([MSTUB-xInt_Only-Rev-Dt],1,2)

Open in new window

0
 

Author Closing Comment

by:blossompark
ID: 39968733
Great thanks ...Works 100%!!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Here's a requirements document template for an integration project (also known as Extract-Transform-Load or ETL) based on my development experience as an SQL Server Information Services (SSIS) developer over the years.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question