Link to home
Start Free TrialLog in
Avatar of sqlcurious
sqlcuriousFlag for United States of America

asked on

Expression in SSIS package for file name

Hi,
I need to automate the package such that it will pick the file for yesterday from the below location
X:\Marketing\MetroWeb\MET1D_SERIAL_DAILY_RTN_041311.txt
I am trying to change the given expression :
"/MET1D_SERIAL_DAILY_RTN_"+(DT_WSTR, 8)  ( (DT_I4) ( (DT_WSTR, 4) YEAR( GETDATE()  )  +
             Right("0"+ (DT_WSTR, 2) MONTH( GETDATE() ) ,2) +
             Right("0"+ (DT_WSTR, 2) DAY( GETDATE()  ) ,2) ) - 1 ) + ".txt"
which gives MET1D_SERIAL_DAILY_RTN_20110413
I am trying to modify and it is not working, please help
Thanks
ASKER CERTIFIED SOLUTION
Avatar of Jason Yousef
Jason Yousef
Flag of United States of America 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
I've it in my blog by the way, please consider following :)

http://asqlb.blogspot.com/2010/11/ssis-get-date-with-leading-zeros.html
Avatar of Alpesh Patel
"\\\\" +  @[User::FILE_SHARE] + TRIM(@[User::Done]) + LTRIM(@[User::FileName]) + RIGHT("0" + (DT_WSTR,2)MONTH(GETDATE()), 2)  + RIGHT("0" + (DT_WSTR,2)DAY( GETDATE()), 2) +  RIGHT((DT_WSTR,4)YEAR(GETDATE()),2) +   ".txt"
Avatar of sqlcurious

ASKER

thnks!
Thanks for the grade and the points :)