January 19, 2011 at 1:21 pm
I need a Quarry that will total a sum then subtract certain columns from that total sum.
Select Salesrep_Customerid,SUM(PaymentAmount MINUS(Totalshippingcost AND Salestax1))As "Weekly Total"
From Orders
Where OrderStatus='Shipped'
Between Orderdate('2011/01/10') AND Orderdate('2011/01/19')
I have this so far..
January 19, 2011 at 1:25 pm
You're close. It's all in the placement of the parenthesis.
SELECT
Salesrep_Customerid
,SUM(PaymentAmount) - (SUM(Totalshippingcost) + SUM(Salestax1)) AS [Weekly Total]
FROM
...........
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgViewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply