Solved

Disallowed Implicit conversion from nVarChar to Money

Posted on 2011-03-07
3
606 Views
Last Modified: 2012-08-13
I keep getting disallowed Implicit conversion from nVarChar to Money for the column [Sum Of Gross] (see code)

I can't solve it when I try to convert...can anyone help?

Thanks
CASE WHEN (dbo.vwPayrollFinalCommission.[Sum Of Gross] - dbo.vwPayrollFinalCommission.[Sum Of NTU]) 
                      > dbo.PayrollTragets.InternalConsultantsTarget THEN (dbo.vwPayrollFinalCommission.[Sum Of Gross] - dbo.vwPayrollFinalCommission.[Sum Of NTU]) 
                      * 0.075 ELSE 0 END AS Comm3

Open in new window

0
Comment
Question by:edjones1
[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
3 Comments
 
LVL 3

Expert Comment

by:ccwill88
ID: 35054949
there have some char data in [Sum Of Gross]?
0
 
LVL 10

Expert Comment

by:Asim Nazir
ID: 35055005
try something like this:
AVG(cast(cast(TagValue as float) as decimal(38, 5))) AS Average
this happens whenn Value has Exponential part in it. Replace column name with yours.

Asim
0
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 500 total points
ID: 35055188

what are the datatype of [Sum Of Gross] and [Sum Of NTU]

I thnik [Sum Of NTU] is money or smething then in this you need to explicitly convert nvarcha to money like thi

CAST(dbo.vwPayrollFinalCommission.[Sum Of Gross] as money)

try this


 CASE WHEN (CAST(dbo.vwPayrollFinalCommission.[Sum Of Gross] as money) - dbo.vwPayrollFinalCommission.[Sum Of NTU])
                      > dbo.PayrollTragets.InternalConsultantsTarget THEN (CAST(dbo.vwPayrollFinalCommission.[Sum Of Gross] as money) - dbo.vwPayrollFinalCommission.[Sum Of NTU])
                      * 0.075 ELSE 0 END AS Comm3
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

710 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