Calculations

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.
 
T

tina

-----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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top