Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 “SELECT SUM(Quantity * Price)” doesn’t work

Author  Topic 

dchan
Starting Member

1 Post

Posted - 2011-09-30 : 11:54:28
I want to know how to properly write a “SELECT” statement in SQL 2005 so I can have it give me the sum of two table fields multiplied. For instance I am trying to get the query to basically multiply Price x Quantity. Unfortunately, “SELECT SUM(Quantity * Price)” doesn’t work

can anyone help? thanks.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-30 : 11:56:58
it will work. what was error when you tried it?also post used query

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

paultech
Yak Posting Veteran

79 Posts

Posted - 2011-10-03 : 10:36:03
see the following link

http://bytes.com/topic/sql-server/answers/721300-using-sum-multiply-one-column-other

Go to Top of Page
   

- Advertisement -