Hi,
I have a column in my access database table and I want to add another column with average of every two numbers, like that:
Field1 field2
A1 “”
A2 (a2+a1)/2
A3 (a3+a2)/2
A4 (a4+a3)/2
An (an+a(n-1))/2
Can everybody help me, please?
Regards,
ersatz
I would not advise storing a calculated field in your database. It is better to have your program do the calculations as necessary.
However each situation is unique and you may have good reasons for storing the calculated values. If so just add them as you would any other field.
Just remember that if you change the values of the data fields then the calculated fields will no longer be correct. That is why it is not recommended. Thanks and Good Luck!
Hi Zemp
Thanks for your response.
I never change the data.
I have a program witch take data from a server and I must make some calculus with that like standard deviation, variance, covariance,relative variation, etc.
For example I don't know to calculate the average for every 40 records in my field
(a1+....a40)/40;
(a2+...a41)/40;etc..
Any idea?
Thanks again,
ersatz
look up aggregate function in VBHelp. There are entries for SUM and COUNT as well as AVG Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.