October 16, 2007 at 7:33 am
We have just move from one server to another. Now I have the following problem:
My DTS's will not run through SQL Query Analyzer, or my Visual Studio front ends, but they run fine in the designer and DTSRUNUI.
When I run one DTS in SQL Query Analyzer using a SP, I get errors regarding date calculations.
Please help - I am almost totally bald now...:w00t:
October 16, 2007 at 7:42 am
I wondering what errors you're getting in date calculations...:cool:
May be you can have a look at your server's default date/time settings...
--Ramesh
October 16, 2007 at 11:33 pm
I wish it was as simple as the date/time settings.
Here is my code:
if DTSSource("ProcDate") > " " then
i_Day = (Mid(DTSSource("ProcDate").Value ,7 , 2 ))
i_Month = (Mid(DTSSource("ProcDate").Value ,5 , 2 ))
i_Year = (Left(DTSSource("ProcDate").Value,4))
end if
DTSDestination("ProcessingDateDate").Value=DateSerial( i_Year , i_Month , i_Day)
i_Day = (Mid(DTSDestination("ProcessingDateDate").Value ,9 , 2 ))
i_Month = (Mid(DTSDestination("ProcessingDateDate").Value ,6 , 2 ))
i_Year = (Left(DTSDestination("ProcessingDateDate").Value,4))
if i_Day > "15" then
i_Day = "15"
DTSDestination("MonthEndDate").value=DateSerial( i_Year , i_Month , i_Day)
DTSDestination("MonthEndDate").value = DateAdd( "M", 1, DTSDestination("MonthEndDate") )
else
i_Day = "15"
DTSDestination("MonthEndDate").value=DateSerial( i_Year , i_Month , i_Day)
Procdate = yyyymmdd (20071017)
ProcessingDateDate and MonthEndDate are defined as smalldatetime.
The error I get is that i_Month is invalid in the last line of code
October 17, 2007 at 2:13 pm
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply