Link to home
Start Free TrialLog in
Avatar of Dreamslogic
Dreamslogic

asked on

SSIS Expression

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,
Avatar of appari
appari
Flag of India image

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)
Avatar of Dreamslogic
Dreamslogic

ASKER

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

ASKER CERTIFIED SOLUTION
Avatar of appari
appari
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial