View Single Post
  #1 (permalink)  
Old 04-29-03, 16:59
fhussain fhussain is offline
Registered User
 
Join Date: Apr 2003
Location: Charlotte, NC
Posts: 3
db2-- Decimal to Varchar without leading zeros

I am trying to cast a Decimal datatype to Varchar using
SELECT cast(char (OUTSTANDINGBAL) as varchar (30))
FROM CREDITTable;

and i get the results as

000000000000012.250

Decimal data type is defined as decimal(18,3) on the CREDITTable.

I need to avoid the leading zeros and get the 12.250 to insert into anothe table.

Is there any way I can do this?
I looked through most of the functions db2 has but it didn't get me anywhere.

I would really apprecaite it if you could forward any examples...

thanks
faris
Reply With Quote