Calculations

  • Thread starter Thread starter Raul Sousa
  • Start date Start date
R

Raul Sousa

I have a table called Party with several fields. One of
these fields is costs.
I have another table called Costs with the fields:
partyId, item and value.
My problem is the following: I want the cost field of the
Party table to be equal to the sum of all Costs of the
partyID.
I have no idea how to do that.
 
-----Original Message-----
I have a table called Party with several fields. One of
these fields is costs.
I have another table called Costs with the fields:
partyId, item and value.
My problem is the following: I want the cost field of the
Party table to be equal to the sum of all Costs of the
partyID.
I have no idea how to do that.

.
the short answer is, you shouldn't do it. Microsoft's
white paper Designing a Database -- Understanding
Relational Design, states:

"Don't include derived or calculated data. In most cases,
you don't want to store the result of calculations in
tables. Instead, you can have Microsoft Access perform the
calculations when you want to see the result."

you already have a one-to-many relationship between Party
and Costs. you can calculate the total cost for a specific
party in a query, form, or report whenever you need to.

hth
 
Back
Top