Compute ordertotal from orderlines

Apr 12 2014 7:14 PM

I'm new at this so sorry for the simple question.

I have 2 tables: orders and orderlines

orders.ordernumber
orders.ordertotal
 
orderlines.ordernumber
orderlines.orderline
orderlines.amount
 
I want to use the Computed Column Specification Formula to define the ordertotal from the orderlines. I tried something like:

SELECT SUM(amoumt) FROM Orderregels WHERE ordernumber=ordernumber

but that one returns an error.
 
How can I achieve what I want (if possible)?
 
Thnx in advance
 
Florian 
 

Answers (3)