Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 No decimal point after converting

Author  Topic 

roger00713
Starting Member

11 Posts

Posted - 2009-11-16 : 18:16:06
Hi.
I am having some trouble with converting a VarChar to a numeric value.
An example is that field "result" is a Varchar and is set as 32.2 and when i select convert(numeric,result) it only gives me back 32 without any decimal points.
I have tried doing some reading on different data types but my understanding is that a numeric data type should accommodate this conversion.
Any help would be greatly appreciated.
Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-11-16 : 18:35:22


select convert(numeric(10,2), '32.2')



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

roger00713
Starting Member

11 Posts

Posted - 2009-11-16 : 18:54:37
Thanks for your help. Missing the 10,2.
Go to Top of Page
   

- Advertisement -