Solved

sum of varchar column

Posted on 2010-11-19
2
684 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

13 Experts available now in Live!

Get 1:1 Help Now