June 24, 2005 at 4:11 am
Hi people,
I am trying to DTS into a text file and one of my outputs needs to convert a number (3625.00) into 003625. I have absolutely no idea what implied zeros are (did I miss that day at school) but am told this is how the figure needs to look.
Oh, and the destination column is fixed width...please help?
Thanks.
JG
June 24, 2005 at 5:29 am
How bout something like:
CAST(CAST(REPLICATE('0', 6 - LEN(@Field)) + @Field AS VARCHAR(6)) AS VARCHAR(6))
Good Hunting!
AJ Ahrens
webmaster@kritter.net
June 24, 2005 at 7:45 am
You can try this from an ActiveX Transform:
Function Main()
DIM sTemp
DIM sSource
DIM sOutput
sTemp = "000000"
sSource = "1234"
sOutput = LEFT(sTemp,(LEN(sTemp) - LEN(sSource))) & sSource
msgbox"Value = " & sOutput
Main = DTSTaskExecResult_Success
End Function
June 24, 2005 at 8:33 am
Thanks a lot guys - both ways will resolve and I'll keep them in my library.
Cheers,
JG
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply