sqlcurious
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\MET1 D_SERIAL_D AILY_RTN_0 41311.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_201 10413
I am trying to modify and it is not working, please help
Thanks
I need to automate the package such that it will pick the file for yesterday from the below location
X:\Marketing\MetroWeb\MET1
I am trying to change the given expression :
"/MET1D_SERIAL_DAILY_RTN_"
Right("0"+ (DT_WSTR, 2) MONTH( GETDATE() ) ,2) +
Right("0"+ (DT_WSTR, 2) DAY( GETDATE() ) ,2) ) - 1 ) + ".txt"
which gives MET1D_SERIAL_DAILY_RTN_201
I am trying to modify and it is not working, please help
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
"\\\\" + @[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(GETD ATE()),2) + ".txt"
ASKER
thnks!
Thanks for the grade and the points :)
http://asqlb.blogspot.com/2010/11/ssis-get-date-with-leading-zeros.html