?
Solved

SSIS Expression

Posted on 2010-09-12
3
Medium Priority
?
375 Views
Last Modified: 2012-05-10
Hi Guys,

 

Input: ProductCatalog_181416_20100513010253_2010517_22715_2010715_172740

Expression Used: SUBSTRING(@[User::FileName], FINDSTRING(@[User::FileName], "_", 1) + 1, FINDSTRING(@[User::FileName],"_",3) - FINDSTRING(@[User::FileName],"_",1)-1)

Output Getting: 181416_20100513010253

 

Out Put Required : 181416_20100513

 

Can please help he out how to get above output.

 

Thanks,
0
Comment
Question by:Dreamslogic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 39

Expert Comment

by:appari
ID: 33659237
is it always same format between 2nd and 3rd occurances of "_"?
if so try
SUBSTRING(@[User::FileName], FINDSTRING(@[User::FileName], "_", 1) + 1, FINDSTRING(@[User::FileName],"_",3) - FINDSTRING(@[User::FileName],"_",1)-7)
0
 

Author Comment

by:Dreamslogic
ID: 33659248
No thats not the same it changes. Here are the examples

ProductCatalog_141199_20100527164603.CSV_201069_20144_2010625_191748_2010714_142617

ProductCatalog_132700_20100706024658.CSV_2010710_185129

ProductCatalog_182404_03072008_201077_201082_05439

Output Required example:

141199_20100527
132700_20100706
182404_03072008

0
 
LVL 39

Accepted Solution

by:
appari earned 2000 total points
ID: 33659266
OK, can we take it as  8 characters after 2nd occurance of "_" is fixed?

if that is the case try

SUBSTRING(@[User::FileName], FINDSTRING(@[User::FileName], "_", 1) + 1, FINDSTRING(@[User::FileName],"_",2) - FINDSTRING(@[User::FileName],"_",1)+7)
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

762 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