Hi
I have source varchar(255) value 123456789123456789 , i am trying to converting this varchar to decimal (18.2) , but i am unble to converting.
I am getting output like all zeros.(0000000000000000.00 )
Any suggessions
Thanks in advance
String to decimal conversion problem
Moderators: chulett, rschirm, roy
String to decimal conversion problem
vijayakumargoud
Re: String to decimal conversion problem
How do you do your convert?
AsDouble(...) or stringToDecim??
isnt it better to do a trim before or use varchar(20)? have u tried those one?
I think it is cause because of blank or some space
hop this helps
Best regards
Arash
AsDouble(...) or stringToDecim??
isnt it better to do a trim before or use varchar(20)? have u tried those one?
I think it is cause because of blank or some space
hop this helps
Best regards
Arash
-
- Premium Member
- Posts: 1044
- Joined: Wed Sep 29, 2004 3:30 am
- Location: Nottingham, UK
- Contact:
Re: String to decimal conversion problem
By 18.2 do you mean Length 18, Scale 2? If so, that's too small to fit 123456789123456789 in. You need Length 20, Scale 2 or Length 18, Scale 0.vasam wrote:Hi
I have source varchar(255) value 123456789123456789 , i am trying to converting this varchar to decimal (18.2) , but i am unble to converting.
Phil Hibbs | Capgemini
Technical Consultant
Technical Consultant