Full Version: average of zero
UtterAccess Forums > Microsoft® Access > Access Forms
So I got some much needed help here before, I had four values that I needed an average from and if any of the fields were left blank then I did not want that field included in the average. The help I got was great, except, when all four values are entered, the average comes up as zero.
What needs to be changed?
Change the last part:
to this:
I am sorry to say, but if you have these as fields in your table, your table structure needs serious help. Your data structure is not properly normalized and will lead to lots of problems down the road. Can you imagine what kind of nasty code you have to write to calculate the standard deviation of these fields if it is needed down the road? You need to take these fields and make them records in a related table so that the database can manage the data better and you will be able to use that power to get the results you want much easier and quicker.
I have attached a set of links to this post that talk about normalization and other database design principles. I suggest you go through them and change your data structure as soon as you can.
Thanks DBguy, that piece worked perfect. Thanks Balaji, I know my DB is an patch-work mess, I have been limping along trying to avoid the full rebuild, your links are going to make it sooo much easier to finally do that. UtterAccess rox!
You're very welcome. Good luck.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.