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!

Type Conversion

Status
Not open for further replies.

mkp2004

Programmer
May 27, 2004
11
US
I have a small problem where I need to have a type converion process in DTS when using an ActiveX script.

eg:
DTSDestination("check_number") = DTSSource ("check_number") + nCounter * 1000

Here the destination is varchar and Source is also varchar..Now I need to cast the source in to long or int and then do the calculation and then cast it back to varchar so that i can pass it to the destination...

PLease help me with this....

regards,
mkp2004
 
VB scripting not my forte. How does this work for you?

DTSDestination("check_number") = CStr(CLng(DTSSource ("check_number")) + nCounter * 1000)

You could switch CLng to CInt to convert to integer rather than long. Good luck!

--John [rainbow]
-----------------------------------
Behold! As a wild ass in the desert
go forth I to do my work.
--Gurnie Hallock (Dune)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top