Solved

Error converting data type nvarchar to numeric.

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
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.
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.

707 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

16 Experts available now in Live!

Get 1:1 Help Now