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 Programming
 adding up

Author  Topic 

sambrown180
Starting Member

38 Posts

Posted - 2008-12-09 : 08:28:42
I have two tables that I need to take the information from Delivery and orderline

I want to be able to work out the cost of the product minus the discount, to make the sub total and then plus add the delivery charge to make the grand total.

delivery charge is in the delivery table and product price, discount and sub total are in orderline

can anyone tell me what coding to write

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-09 : 09:31:23
[code]SELECT *,ol.Product_Price-ol.Discount+d.delivery_charge AS Total
FROM Delivery d
INNER JOIN orderline ol
on ol.orderid=d.orderid[/code]

I assume you've orderid on both tables,if not use the column by which they're related instead
Go to Top of Page
   

- Advertisement -