[AccessD] Age calculation function

Gustav Brock gustav at cactus.dk
Fri Aug 1 12:49:12 CDT 2003


Hi Mark

>   Are you saying 14 and 31 are correct or incorrect?  I would think they are
> correct.  If so, using DateDiff with "m" and dividing by 12 will work.   I
> think you're saying those values are correct, but if not, I'm confused.

No no, I say those values are correct.
But I don't quite understand the month-thing ... it will fail in about
50% of any calculation as it doesn't take the day into account:

  #02/29/1988#, #02/18/2002#
  should return 13, not 14.

I've heard of a couple celebrating their 25 year wedding day 24 years
after their wedding because the wife couldn't count to 25. That is
just fun - they can celebrate it once again at the real date - but for
business applications dealing with pensions, salaries, holidays etc.
getting the wrong age or employment period is mandatory and you have
to use reliable calculation methods.

/gustav


>> You may wish to look up "Age Calc" in the archives around Okt. 2002.
>>
>> Many of the "smart" suggestions will fail for date intervals like:
>>
>>   #03/01/1988#, #03/01/2002#
>>   is 14
>>
>>   #03/01/1968#, #02/28/2000#
>>   is 31



More information about the AccessD mailing list