I got some help in another thread to create this table-valued function:
CREATE FUNCTION dbo.GetAwdYrTbl ()
RETURNS @AwdYrTbl TABLE (
AwdYr VARCHAR(7)
, YearID VARCHAR(2)
, Nbr VARCHAR(1)
)
BEGIN
Declare @TodayYr VARCHAR (4)
Declare @TodayMn VARCHAR (2)
Declare...
...UNION ALL SELECT @AwdYr2,RIGHT(@AwdYr2,2),'2' UNION ALL SELECT @AwdYr3,RIGHT(@AwdYr3,2),'3'
ELSE INSERT INTO @AwdYrTbl
SELECT @AwdYr2,RIGHT(@AwdYr2,2),'1' UNION ALL SELECT @AwdYr3,RIGHT(@AwdYr3,2),'2'
SELECT * FROM @AwdYrTbl
EXEC('CREATE VIEW vw_Dynamic_Year AS SELECT * FROM @AwdYrTbl')
I've got working code (thanks to help from this forum) that will write to a file the first 42 characters of each line in numerous files. Works like a charm. However, I now have a need to also write characters from 10 other areas of each line.
For instance, in the code below, i need to modify...
One more question...I was testing this locally and it worked. When I changed the MainPath to a network share instead of hard drive, it doesn't work. Is that something to do with FileSystemObject and if so, how do I correct?
Instead of this:
MainPath = "C:\_Temp_Delete\Daily Reports"
I need...
Trying to write a script to move files with last month's date in the filename to an archive folder that exists in the same folder. For instance:
C:\_Temp_Delete\Daily Reports\Report 1 folder --> this is where the file initially resides
C:\_Temp_Delete\Daily Reports\Report 1...
Then I'm confused as to why it works when i run it with the search path set to local drive. For the first sub (SearchFolders), I'm calling that when the user clicks a button. How can I subsequently call the ShowSubFolders sub after the SearchFolders sub runs? I would have thought the call to the...
Thanks for your help guys, I think I'm almost there. I've gotten it to work locally when I have the path set to c:\prod\saig. However, when I change it to a network share, nothing happens. There is no error, it just doesn't write to the log. Also, my CompleteMsg sub runs for each file found, I...
Thanks PHV. I just added that as the first line and now I'm getting the same msg "invalid procedure call or argument" but now getting it on the set objFolder = objFSO.GetFolder(strDir) line (line 6 in the code above).
I thought the part in green was indicating that I didn't need it because it was redundant...when I run this, I get "invalid procedure call or argument" on the Set objTextFile:
strDir = "c:\prod\saig"
LogPath = "C:\Search_SAIG"
set objFSO = CreateObject("Scripting.FileSystemObject")
sub...
Sorry guys, but I'm a bit confused. So for this code, if I run it on its own, I'm still not getting any results at all...I mean, I run the vbs file and...nothing. I'm sure it's something I'm doing wrong...this is what I'm running:
strDir = "c:\prod\saig"
LogPath = "C:\Search_SAIG"
set objFSO =...
Maybe I should have prefaced this post by saying that I don't really know what I'm doing...although that is probably fairly obvious from my responses. I had been trying to avoid using the function because I already have this code as part of a sub where I gather input from user (HTA wrapper) and...
I think I'm almost there...the script will complete now, but it doesn't actually write to the file like I'm telling it to...which I assume means I'm not truly finding the right subfolder that contains my files?
MainPath = "c:\prod\saig"
Set oFolder = fso.GetFolder(MainPath)
For each...
Thanks Geates. But my problem is that I'm trying to avoid having to indicate the \\server\share piece. If I have to enter the full path, then I'll need to hard-code over 100 paths.
So instead of this:
n:\prod\00572\From-Other\YYYYMMDD-Download
n:\prod\00573\From-Other\YYYYMMDD-Download...
The closest thing I can find is a script that will recursively search every subfolder in a main folder. That is a problem for me because I need it to search only a specific subfolder within a subfolder within a subfolder with a folder (in my example above, 00572 has other subfolders, but I'm...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.