Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Age calculations
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00179005
Message ID:
00179815
Views:
22
I read the MS article. They seem to think that someone who is 64.6 is actually 65 (because they are rounding). If you use their method, that person born on February 28, 1979 has their first bithday (ie. turns 1) on August 30, 1979. I think MS should remove/replace this entry. :-)

In my business (insurance), sometimes the question as to whether a person is 65 or 64.9999234 is a big one.

Take care Ken,
Joe


>Hmmm... switching the floor function to a round() as in Microsoft KB Article How To Calculate a Person's Current Age solves this particular example. Are there other instances where this does not work? If so, perhaps MS should remove/replace this entry.
>
>So, can we all agree on a single best method to be used along with an explaination why to be posted as an FAQ? Perhaps including "Why Not's" for other methods.
>
>Thanks for pointing this out Joe!
>
>>Hi Ken,
>>
>>Try born on February 28, 1979.
>>
>>Age on February 28, 1980: 0
>>Age on February 28, 1981: 2
>>Age on February 28, 1982: 3
>>Age on February 28, 1983: 4
>>Age on February 28, 1984: 4
>>Age on February 28, 1985: 6
>>
>>The problem is that some date ranges will have more than (# years/4) leap years and some will have less...
>>
>>Joe
>>
>>>Hiya Mike,
>>>
>>>Try:
>>>
>>>floor((date() - d_Birth)/365.25)
>>>
>>>The value 365.25 accounts for leap years.
>>>
>>>>greetings to all
>>>>
>>>>i need the code for calculating the age as follows:
>>>>i habe a field where we input the date.
>>>>i need to calculate the age on another field based on the current date
>>>>
>>>>any ideas?
>>>>
>>>>regards
>>>>mike peizate
Joseph C. Kempel
Systems Analyst/Programmer
JNC
Previous
Reply
Map
View

Click here to load this message in the networking platform