Solved

Error converting data type nvarchar to numeric.

Posted on 2008-10-21
3
960 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

726 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