Solved

sum of varchar column

Posted on 2010-11-19
2
685 Views
Last Modified: 2012-05-10
select SUM(paymentfee) from payments where  
(
(type='Paypal' and 'confirmation'!='' and resultcode!='Denied' and resultcode!='unconfirmed')
or
(type!='Paypal')
)


Msg 8117, Level 16, State 1, Line 1
Operand data type varchar is invalid for sum operator.
0
Comment
Question by:rgb192
2 Comments
 
LVL 9

Accepted Solution

by:
JonMny earned 500 total points
ID: 34175823
select Sum(Cast(paymentfee As Decimal(10,2)))
0
 

Author Closing Comment

by:rgb192
ID: 34175850
thanks
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

Suggested Solutions

Title # Comments Views Activity
OPENDATASOURCE 8 36
PK numbers not follow 8 61
SQL Server DeDupe Table 3 37
ISDATE() not working properly on my table? Any suggestions. 7 10
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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

11 Experts available now in Live!

Get 1:1 Help Now