dbTalk Databases Forums  

File name

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss File name in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
anonymous
 
Posts: n/a

Default File name - 02-01-2005 , 07:44 AM






In activeX I have the following VBscript.
Where I getting the filename and location from Connection
Source.
I need to add the date to the file name by using the code
below the date
is adding at the end of the file name after .txt. I need
to add before the .txt
to look like that \\filenamedate.txt
How do I do this?
Set oConn = oPkg.Connections("Text File (Source)")
sFilename = oConn.DataSource & Day(Now() )




Reply With Quote
  #2  
Old   
Sue Hoegemeier
 
Posts: n/a

Default Re: File name - 02-01-2005 , 02:25 PM






I'm not exactly clear on what you need but I think what you
are after is something where you use a Left and Len to strip
out the .txt part of the file name. Then concatenate the
value from the date function Day(Now()) and add the .txt.
Something like:
Left(sFilename, Len(sFilename) - 4) & Day(Now()) & ".txt"

-Sue

On Tue, 1 Feb 2005 05:44:36 -0800, "anonymous"
<anonymous (AT) discussions (DOT) microsoft.com> wrote:

Quote:
In activeX I have the following VBscript.
Where I getting the filename and location from Connection
Source.
I need to add the date to the file name by using the code
below the date
is adding at the end of the file name after .txt. I need
to add before the .txt
to look like that \\filenamedate.txt
How do I do this?
Set oConn = oPkg.Connections("Text File (Source)")
sFilename = oConn.DataSource & Day(Now() )




Reply With Quote
  #3  
Old   
LP
 
Posts: n/a

Default Re: File name - 02-03-2005 , 10:09 PM



This works like a charm
http://www.sqldts.com/default.aspx?200


"Sue Hoegemeier" wrote:

Quote:
I'm not exactly clear on what you need but I think what you
are after is something where you use a Left and Len to strip
out the .txt part of the file name. Then concatenate the
value from the date function Day(Now()) and add the .txt.
Something like:
Left(sFilename, Len(sFilename) - 4) & Day(Now()) & ".txt"

-Sue

On Tue, 1 Feb 2005 05:44:36 -0800, "anonymous"
anonymous (AT) discussions (DOT) microsoft.com> wrote:

In activeX I have the following VBscript.
Where I getting the filename and location from Connection
Source.
I need to add the date to the file name by using the code
below the date
is adding at the end of the file name after .txt. I need
to add before the .txt
to look like that \\filenamedate.txt
How do I do this?
Set oConn = oPkg.Connections("Text File (Source)")
sFilename = oConn.DataSource & Day(Now() )





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.