View Full Version : TotalPrice from Price in another table


nothing_more
03-29-2005, 06:31 AM
Hi all
I have a tblTransactions. Each transaction in it has a price.
I have a tblOrders. Each order is made up of many transactions.
How do I calculate the Total Price of the order?
Thanks in advance
Matt

PS Both Transactions and Orders have ID's, obviously

nothing_more
03-29-2005, 06:44 AM
Just thought I'd add....

I want the total price to be stored permanantly in the tblOrders ie. its always there.

neileg
03-29-2005, 07:48 AM
Just thought I'd add....

I want the total price to be stored permanantly in the tblOrders ie. its always there.Why? You shouldn't store data that is easilly calculated when you need it.

For a total order value, you could do it in a form/subform, in a report or in a totals query.

Create query that joins orders with tranactions on the ID. Add whatever order detail you want from orders, and add the transaction value from transactions. Then total the transaction value field.