June 29, 2009 at 4:33 pm
Hello Gentlemen,
I have the following piece of simple of DTS Activex Script. Excuse me for my ignorance. The "if condition" is the problem here. I would appreciate the syntax correction or any other method to handle such situations.
'**********************************************************************
' Visual Basic Transformation Script
'************************************************************************
' Copy each source column to the destination column
Function Main()
DTSDestination("TRANS") = DTSSource("Id")
DTSDestination("DATE_CRTD") = DTSSource("Datep")
DTSDestination("FILE_NO") = DTSSource("Filenum")
DTSDestination("FILE_DATE") = DTSSource("FileDt")
If DTSSource("File Type") = "SSA" Then
DTSDestination("RECTYPE") = "Y"
Else
DTSDestination("RECTYPE") = "N"
End If
DTSDestination("SUP_DATE") = DTSSource("SupDt")
DTSDestination("PIN_NO") = DTSSource("PinNum")
Main = DTSTransformStat_OK
End Function
July 8, 2009 at 7:17 pm
If File Type is a field from the database then you could use a CASE statement in the source select statement
Like:
RECTYPE = CASE WHEN [File Type] = 'SSA' THEN 'Y' ELSE 'N' END
CEWII
July 8, 2009 at 8:39 pm
If File Type is a field from the database then you could use a CASE statement in the source select statement
Like:
RECTYPE = CASE WHEN [File Type] = 'SSA' THEN 'Y' ELSE 'N' END
CEWII
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply