![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I know how I would do it in SSIS, and hopefully the same general process would apply in DTS: Set up a global variable that will hold the file name value. Create an ActiveX script that will figure out the MM and DD part of yesterday's date and assign the variable value to a concatenation of all the elements needed. I have done this very thing in SSIS. Sorry I cannot give you details on how to do it in DTS. HTH -- Todd Chittenden "qjlee" wrote: Hi, I am setting up a dts package. One of the the step is to grab a file from a ftp site, the file is name as ABCMMDD, the MMDD being yesterday's date. How I can configure it. Thanks, |
#3
| |||
| |||
|
|
Here is a script excerpt that sets a filename with YESTERDAY'S datestamp: **************** CODE ***************** Dim Today As System.DateTime Dim Yesterday As System.DateTime Dim t As String Dim yy As String Dim mm As String Dim dd As String Today = System.DateTime.Now Yesterday = Today.AddDays(-1) yy = Right(CStr(Year(Yesterday)), 2) mm = CStr(Month(Yesterday)) If Day(Yesterday) < 10 Then dd = "0" + CStr(Day(Yesterday)) Else dd = CStr(Day(Yesterday)) End If 'dd = "24" t = "< My File Path and name >" + yy + mm + dd ******************* END ***************** Now, I'm sure that some VB.NET guru out there will tell me there is a better way to do this, but it works for me. You may have trouble using exactly as is in DTS. Like I said, I'm not familiar with Scripting in DTS. Good luck! |
![]() |
| Thread Tools | |
| Display Modes | |
| |