March 27, 2009 at 6:57 am
Hey I've an ssis package that deals with many files on a weekly basic. so i drop all of the file into a weekly folder named W01 , W13 etc. but this mean that i have to keep changeing my foreach loop to point at the weekly folder thats created.
Is there a way that i can do this without having to manually change the foreach to point to the weekly folder.?
I've created avariable and i've stored the path in the variable.
example i've stored this path \et\loc\files
I was trying to use the expression in the foreach to sent the property of the option directory to be the variable +'W'+ datepart(wk,getdate())
so it would give me \et\loc\files\W13
but i can't get the expression to work.
April 1, 2009 at 7:13 pm
Try this
"\et\loc\files\W"+ (DT_STR, 200, 1252) DATEPART( "wk", GETDATE() )
April 1, 2009 at 7:15 pm
Correction!
"\\et\\loc\\files\\W"+ (DT_STR, 200, 1252) DATEPART( "wk", GETDATE() )
April 2, 2009 at 4:26 am
this worked for me thanks , but can i use the getdate()-1 in the expression ? i need to use the -1 to look for the folder for the pervious week..
April 2, 2009 at 5:32 pm
Yes, that should work. I do not know exactly how it defines week of the year (does it begin on a Sunday or the day Jan 1 lands on, for example) so you may need to do some experimenting.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply