I am trying to write a script that effectively removes timestamp values, so that I can import data into sql server 2000 using dts. I have post this on the sql server site - to no avail, so thought I might try a different approach. Could anyone tell me what is wrong with the following code - it errors at line 1.
Function Main()
Dim IDate as variant,
Dim ITime as variant,
Dim IDateTime as variant
On error resume next ' Just keep on going
IDate=DTSSource("Date"
ITime=DTSSource("Time"
if isnull(IDate) then IDate = "01/01/1900"
if isnull(ITime) then ITime = "00:00:01"
if not isdate(IDate) and ITime = "00:00:01" then ' Looks like the Time is in the date field
ITime = IDate
IDate = "01/01/1900"
endif
if not isdate(IDate) then Idate = "01/01/1900" ' Catch all
IDateTime = "'" & trim(IDate) & " " & trim(ITime) & "'"
DTSDestination("IDateTime"
On error goto 0 ' Resume error trapping
Main = DTSTransformStat_OK
End Function
All responses are very much appreciated
Sarah
Function Main()
Dim IDate as variant,
Dim ITime as variant,
Dim IDateTime as variant
On error resume next ' Just keep on going
IDate=DTSSource("Date"
ITime=DTSSource("Time"
if isnull(IDate) then IDate = "01/01/1900"
if isnull(ITime) then ITime = "00:00:01"
if not isdate(IDate) and ITime = "00:00:01" then ' Looks like the Time is in the date field
ITime = IDate
IDate = "01/01/1900"
endif
if not isdate(IDate) then Idate = "01/01/1900" ' Catch all
IDateTime = "'" & trim(IDate) & " " & trim(ITime) & "'"
DTSDestination("IDateTime"
On error goto 0 ' Resume error trapping
Main = DTSTransformStat_OK
End Function
All responses are very much appreciated
Sarah