Page 1 of 1

Want to trim the leadin zero in a varchar

Posted: Fri Nov 06, 2009 7:41 am
by gssr
I need the following requirement:
Input Sample
000029.96
00000.00
00156.01
00007.12

Required output:
29.96
0.00
156.01
7.12

The dattypes varchar!!

i used the TRIM function to remove the leading zeroes...
TRIM (Link1,'0',"L")

But it is not working...
Can anyone suggest me a solution..

Thanks in advance

Posted: Fri Nov 06, 2009 7:55 am
by chulett
First off, what makes you think it is not working? What is your target field after the trim, another varchar or a decimal?

Posted: Fri Nov 06, 2009 8:03 am
by gssr
chulett wrote:First off, what makes you think it is not working? What is your target field after the trim, another varchar or a decimal? ...
I tried it, and the output is not changing. The target Column datatype is also Varchar! :cry:

Posted: Fri Nov 06, 2009 8:07 am
by chulett
And is your actual syntax more like TRIM(Link1.ColumnName,'0',"L") and what stage are you doing this in?

Posted: Fri Nov 06, 2009 8:14 am
by gssr
Yes ,i am using the same syntax ,And i am doing this in a Transformer Stage!

Posted: Fri Nov 06, 2009 8:16 am
by gssr
The Problem is solved ....Actually there are some spaces and hence i tried the followingand it is fine now!!

Trim((TrimLeadingTrailing(Link1.Column)),'0',"L")

Thanks for your comments,