Caculating fields

w0od0o

Registered User.
Local time
Today, 16:59
Joined
Jan 13, 2009
Messages
87
hi, i am looking to try and get 2 fields in a table to add together and then show data in another field

for examaple: cost + VAT = Total

which would be the best way to do this, in a table, query or form?

thanks

w0od0o
 
NOT in a table, never store calculated values.

Just do it in a query or a form/report where applicable.
 
Was lying in bed and realised I need to expand on my answer.

If you have a single form do the calculation the form. If however you have a continuous form do the calculation in the underlying query. As you can not sum fields calculated on a continuous form, but you can sum them if they have been calculated by the query that is feeding the form.
 
thanks both, so the total field in my table is redundant and should be removed?
 
another quick question i hope, ive decide to use a query to do my calcs but should i use the data from the table, query or form to work out the calcs?

thanks
w0od0o
 
thanks both, so the total field in my table is redundant and should be removed?

Yes... rule #1, dont store calculated values

Your data is always from the table... that is where the actual values are stored...
 
thanks again, last but not least how do i get the values to display as currency?
if i have....
total: [cost]+[vat]

would there be some way of tell it to display as currency?
 
Right click the grey bar above it in the query design and set it to display as currency
 

Users who are viewing this thread

Back
Top Bottom