March 12, 2014 at 8:01 am
I have a package creating multiple files, which end up on a share folder, which i am creating dynamically, based on the date/time.
The folder expression is like this:
@[User::Path] + (DT_WSTR, 50 ) DATEPART( "YEAR", DATEADD( "qq", -1, GETDATE() ) ) +"Q"+ (DT_WSTR, 50 ) DATEPART( "QUARTER", DATEADD( "qq", -1, GETDATE() ) ) +"\\"+ (DT_WSTR, 50 ) DATEPART( "MONTH", GETDATE() ) + (DT_WSTR, 50 ) DATEPART( "DAY", GETDATE() ) +"."+ (DT_WSTR, 50 ) DATEPART( "HOUR", GETDATE() ) + (DT_WSTR, 50 ) DATEPART( "MINUTE", GETDATE() )
which evaluates to something like
\\(Network location)\(base path)\2013Q4\312.951
that's unique for this minute, with the year and quarter 1 behind the current, 3/12 9:51AM.
So this works fine. But my problem is that if the package lasts more than a minute, the files at the end that get moved to this folder fail because it is looking for folder ....\312.952
Is there a way for the expressions or variables to stay the same throughout runtime (unless explicitly updated)?
My alternative would be to create all of the files locally and then the new folders at the last minute, and copy them all over?
I am attempting at avoiding making those changes, if there is a setting that can achieve what I am talking about.
open to your suggestions.
March 12, 2014 at 8:55 am
Try using the system start date [System::StartTime] instead of GetDate(). It's the datetime that the package starts. See http://technet.microsoft.com/en-us/library/ms141788.aspx for more details about system variables.
March 12, 2014 at 9:11 am
Dead on!
Very perceptive, thanks.
:hehe:
March 12, 2014 at 9:22 am
Glad you got it working. 🙂
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply