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.
| 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 orderlineI 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 orderlinecan 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 TotalFROM Delivery dINNER JOIN orderline olon ol.orderid=d.orderid[/code]I assume you've orderid on both tables,if not use the column by which they're related instead |
 |
|
|
|
|
|