Autosum

S

Ste Hughes

I have 3 fields in a table, one of the fields contains a "price per unit". a second field contains the quantity purchased, I want the 3rd field to aotumatically display the total amount, i.e. Price per unit * Quantity purchased. Can anyone please tell me how to do this please - ripping my hair out here :-

thnx in advanc

Stev
 
R

Rick Brandt

Ste Hughes said:
I have 3 fields in a table, one of the fields contains a "price per
unit". a second field contains the quantity purchased, I want the 3rd field
to aotumatically display the total amount, i.e. Price per unit * Quantity
purchased. Can anyone please tell me how to do this please - ripping my
hair out here :-(

In a Database one does not do calculations *in tables*. Remove the field
from the table. Then build a query with all of the fields in the table and
add a calculated field using the expression...

Total: Nz([Price per unit],0) * Nz([Quantity purchased],0)

(The Nz() functions are there to handle null values.)

Now you simply use the query in places where you were using the table and
which require the Total field.
 
C

Cheryl Fischer

Steve,

What you are trying to do is not considered good database design. Remove
that third field, TotalAmount, as it is redundant. When you do reports and
queries, you can always do the calculation (PricePerUnit * Quantity) to show
a total.

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Ste Hughes said:
I have 3 fields in a table, one of the fields contains a "price per unit".
a second field contains the quantity purchased, I want the 3rd field to
aotumatically display the total amount, i.e. Price per unit * Quantity
purchased. Can anyone please tell me how to do this please - ripping my hair
out here :-(
 

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