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...
I've got a query that works perfectly when run on its own and returns what I need it to. When I try to wrap it into a view as displayed below, I'm getting an error "Must declare the table variable "@AwdYrTbl"
I'm sure this is some kind of syntax thing I'm doing wrong. How can I fix it?
--...
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...
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.