Solved

Error converting data type nvarchar to numeric.

Posted on 2008-10-21
3
953 Views
Last Modified: 2008-10-21
Trying to update a MONEY col with values from a nvarchar(20)
I get the error  Error converting data type nvarchar to numeric.

How do I do this.. the data in the format  "123.50"
0
Comment
Question by:JElster
  • 2
3 Comments
 
LVL 16

Expert Comment

by:brad2575
ID: 22768310
use this to convert the field
cast(NvarcharField as money)
0
 
LVL 1

Author Comment

by:JElster
ID: 22768931
Cannot convert a char value to money. The char value has incorrect syntax.


select Cast(commsamt as money)  from Commissions

Commsamt is nvarchar 20 " 1243.54"
0
 
LVL 16

Accepted Solution

by:
brad2575 earned 50 total points
ID: 22768968
try

cast(cast(NvarcharField as decimal(20, 2)) as money)
0

Featured Post

[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now