Thread: Average Age
View Single Post
  #2  
Old February 12th, 2010, 06:09 PM posted to microsoft.public.access.gettingstarted
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Average Age

Why not average and then apply the function called Diff2Dates?

--
Build a little, test a little.


"Laura" wrote:

I'm doing end of term reports for pupils in a school whereby each report
needs to show the age of the pupil on a given date in YEARS and MONTHS (not
a fraction of the year). In other words, 10 yrs and 3 months, (not 10.25).
I've managed to use a function called Diff2Dates Author: © Copyright 2001
Pacific Database Pty Limited Graham R Seach MCP MVP
to display the pupils age in years and months fine, but I ALSO need to show
the Average Age of the Class in Years and Months.

Simply adding up the results of the Function above and dividing by the
number of children did not work accurately, nor did using AVG as the result
was a fraction of the year and not the exact average of months.

Does anyone have a function for calculating the Average Age in Years and
Months, please?

Thanks
Laura


.