VBscript to check for invalid dates in DTS Data pump task produces error

  • I am trying to use the following script to test dates in a column from a Foxpro source.

    If Year( DTSSource("Date") ) < 1900 Then
    DTSDestination("Date") = null
    Else
    DTSDestination("Date") = DTSSource("Date")
    End If
    Main = DTSTransformStat_OK

    I am getting the following error when I run the task...

    Error Source: Microsoft Data Transformation Services (DTS) Data Pump
    Error Description: The number of failing rows exceeds the maximum specified.
    Error Code: 0
    Error Source=Microsoft VBScript runtime error
    Error Description: Invalid procedure call or argument: 'DTSSource'

    Error on Line 6

    I am using SQL2K Sp3a.
    Thanks.

  • Have you tried using the isdate function, i.e.:-

    If IsDate(DTSSource("Date")) =1 Then

        DTSDestination("Date") = DTSSource("Date")

    Else

        DTSDestination("Date") = Null

    End If

    Main = DTSTransformStat_OK

     

     

  • No, I haven't. Will try this next.

    Thanks Chris!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply