Solved

Error converting data type nvarchar to numeric.

Posted on 2008-10-21
3
958 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

860 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