Page 1 of 1

how to remove commas ?

Posted: Wed Jan 05, 2005 11:42 pm
by jayawant_hsbc
hi my problem is that,
we r reading frm a flat file and the digits are seperated by commas and we need to remove the commas ex
1,500.00 is to be formatted to 1500.00.
tell me the solution using enterprise edition as well as server edition
thankyou

Posted: Thu Jan 06, 2005 12:40 am
by rasi
Hi

In Server there are so many ways to do this. The easiest is to replace , with nothing. Also you can use Oconv(Oconv(Input,"MCN"),"MD2") to convert it to your format.

Re: how to remove commas ?

Posted: Thu Jan 06, 2005 12:47 am
by nchincholikar
[quote="jayawant_hsbc"]hi my problem is that,
we r reading frm a flat file and the digits are seperated by commas and we need to remove the commas ex
1,500.00 is to be formatted to 1500.00.
tell me the solution using enterprise edition as well as server edition
thankyou[/quote]

Try using
Oconv(IConv(To_T.Salary,"MD2"),"MD2")

Regards
Naren

Posted: Thu Jan 06, 2005 1:10 am
by ray.wurlod
The fastest solution is Convert(",", "", TheNumber) - to which rasi alluded.
This function is available in both server and enterprise (parallel) editions.
For mainframe (390) jobs the CONVERT function is not available; you would need to manufacture something using POSITION, SUBSTRING and CHARACTER_LENGTH built-in functions.