Do you have a question? Post it now! No Registration Necessary. Now with pictures!
August 25, 2005, 12:34 am
rate this thread
I'm writing an Sql Statement to total the sale of an order
TotalSale=(TotalSale + (QtyShipped * Price)). I have the syntax & it works
However, I'd like to add Tax + Freight that is derived from another table.
How do I get it to add only once.
Here's the Statement:
"Select Orders.`Order_#`, Orders.`Cust_#`, Orders.`Name`, Orders.Date,
Orders.Status, Orders.`Po_#`, Sum(Olitems.Qty_Shipped * Olitems.Price) As
Total_Sale From Orders, Olitems Where Orders.`Order_#` = Olitems.`Order_#`
Group By Orders.`Order_#` Order By Orders.`Order_#` "
Olitems=Line Item Table
I'd like to include:
Sum((Olitems.Qty_Shipped * Olitems.Price) + Orders.Tax + Orders.Freight) As
When I do that it keeps on adding tax & freight for each line item! How to
work around that?
Thanks for all your help.
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum