Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do an "Array" in transformation with Active X

Status
Not open for further replies.

sgp_imported

Technical User
Sep 11, 2001
8
US
The following works but I would like to figure out how to use "Array" like I do in Crystal i.e. ...in ["A","B","C"].

Thanks!



'**********************************************************************
' Visual Basic Transformation Script
'************************************************************************

' Copy each source column to the destination column
Function Main()
DTSDestination("J_SOURCE") = DTSSource("J_SOURCE")
DTSDestination("GL_ACCT_NO") = DTSSource("GL_ACCT_NO")
DTSDestination("REF_NO") = DTSSource("REF_NO")
DTSDestination("LIST_NO") = DTSSource("LIST_NO")
DTSDestination("ORG_AND_ACCT_NO") = DTSSource("ORG_AND_ACCT_NO")
DTSDestination("TR_AMOUNT") = DTSSource("TR_AMOUNT")
DTSDestination("TRANS_DATE") = DTSSource("TRANS_DATE")
DTSDestination("VEND_INVOICE") = DTSSource("VEND_INVOICE")
DTSDestination("VEND_NUM") = DTSSource("VEND_NUM")
DTSDestination("MONTH") = DTSSource("MONTH")
DTSDestination("YEAR") = DTSSource("YEAR")
'-------------------------------------------------------------------------------------------------------------------------------------------------------------
IF DTSSource("MONTH") = "7" then
DTSDestination("$CMT") = DTSSource("TR_AMOUNT")
Else
DTSDestination("$PRIOR") = DTSSource("TR_AMOUNT")
end if
'----------------------------------------------------------------------------------------------------------------------------------------------------------
IF LEFT(DTSSource("REF_NO"),1) = "X" then
DTSDestination("GL_PO") = MID (DTSSource("REF_NO"),2,5)
Else
IF LEFT(DTSSource("REF_NO"),1) = "x" then
DTSDestination("GL_PO") = MID (DTSSource("REF_NO"),2,5)
Else
IF LEFT(DTSSource("REF_NO"),1) = "N" then
DTSDestination("GL_PO") = MID (DTSSource("REF_NO"),2,5)
Else
IF LEFT(DTSSource("REF_NO"),1) = "n" then
DTSDestination("GL_PO") = MID (DTSSource("REF_NO"),2,5)
Else
IF LEFT(DTSSource("REF_NO"),1) = "D" then
DTSDestination("GL_PO") = MID (DTSSource("REF_NO"),9,5)
Else
IF LEFT(DTSSource("REF_NO"),1) = "M" then
DTSDestination("GL_PO") = MID (DTSSource("REF_NO"),2,5)
Else
IF LEFT(DTSSource("REF_NO"),1) = "P" then
DTSDestination("GL_PO") = MID (DTSSource("REF_NO"),2,5)
Else
IF LEFT(DTSSource("REF_NO"),1) = "A" then
DTSDestination("GL_PO") = MID (DTSSource("REF_NO"),2,5)
Else
IF LEFT(DTSSource("REF_NO"),1) = "F" then
DTSDestination("GL_PO") = MID (DTSSource("REF_NO"),2,5)
Else
IF RIGHT(DTSSource("REF_NO"),1) = "X" then
DTSDestination("GL_PO") = LEFT (DTSSource("REF_NO"),5)
Else
IF RIGHT(DTSSource("REF_NO"),1) = "N" then
DTSDestination("GL_PO") = LEFT (DTSSource("REF_NO"),5)
Else
IF MID(DTSSource("REF_NO"),7,1) = "P" then
DTSDestination("GL_PO") = LEFT (DTSSource("REF_NO"),5)
Else
IF RIGHT(DTSSource("REF_NO"),1) = "A" then
DTSDestination("GL_PO") = LEFT (DTSSource("REF_NO"),5)
Else
IF RIGHT(DTSSource("REF_NO"),1) = "B" then
DTSDestination("GL_PO") = LEFT (DTSSource("REF_NO"),5)
Else

DTSDestination("GL_PO") = DTSSource("REF_NO")
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
Main = DTSTransformStat_OK
End Function

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top