SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 error to convert nvarchar to numeric
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

peace
Constraint Violating Yak Guru

373 Posts

Posted - 08/15/2013 :  03:18:04  Show Profile  Reply with Quote
im hitting error to convert nvarchar to numeric.

my data as below:

2721.000000000000

how can i convert to be just 2721?

khtan
In (Som, Ni, Yak)

Singapore
17438 Posts

Posted - 08/15/2013 :  05:32:35  Show Profile  Reply with Quote
convert(decimal(10), '2721.000000000000')



KH
Time is always against us

Go to Top of Page

peace
Constraint Violating Yak Guru

373 Posts

Posted - 08/15/2013 :  05:38:34  Show Profile  Reply with Quote
what if there's percentage behind? can this convert still be use?

2721.000000000000 %
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17438 Posts

Posted - 08/15/2013 :  07:19:22  Show Profile  Reply with Quote
convert(decimal(10), replace('2721.000000000000 %', '%', '')



KH
Time is always against us

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000