calculations in tables

munday63

Registered User.
Local time
Today, 17:58
Joined
Feb 22, 2005
Messages
18
Hi i have a table with 3 columns for different values

is their any way of adding together the data from 3 to create an extra column which shows the total of all three added together without using a query?
 
munday63 said:
Hi i have a table with 3 columns for different values

is their any way of adding together the data from 3 to create an extra column which shows the total of all three added together without using a query?

Again, look up normalisation - this is the first of the problems you will encounter by not meeting the relevant normal forms.
 
is their any way of adding together the data from 3 to create an extra column which shows the total of all three added together without using a query?

Yes - and the moment you do this, you will find the upkeep too terrible to mention. The first time you update your table in one of the "static" columns, you will scratch your head wondering why the total didn't update.

This is why you use queries. With a query, you can add the three columns together to form your totals as a named field in the QUERY - and then use that query any place you would have used the table. Only now you have the total just like you wanted it. AND it will update automatically if you update one the three contributing columns.

SJ's comment about normalization is this: The value of the totals column de-normalizes the table because it doesn't depend entirely and only on the prime key of the table. It depends on the values of the other columns, too.
 
Normalisation is a bitch to learn. We lost 6 weeks at college because the guy assigned to teach it us couldn't teach for toffee. :mad:

Lol :D
 
ah, the rules of normalisatoin

make sure each attibute is atomic...unique to the record
make sure the only single value dependancies are upon the whole of the primary key
then u got 1st form, 2nd form, 3rd form, boyce codd, 4th...5th
 
All I know about normalisation is that it's a posh word for making your database work properly. I'm not a proper programmer, but I find that my applications end up pretty well normalised.

Why don't you want to use a query, by the way? You could do the sum in a form or report if that suits you better, but as has been mentioned, you don't want to store it.
 

Users who are viewing this thread

Back
Top Bottom