Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Age from DOB
Message
From
12/03/2005 21:48:09
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
12/03/2005 21:26:52
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00995229
Message ID:
00995231
Views:
24
>Hi does anybody how to calculate age base on date of birth? tnx

A while ago there was a discussion about this topic. One particular solution made me marvel, at its utter simplicity.

IIRC, it was something like this:
date2 = date()
date1 = {^1965-11-23}
? int((val(dtos(date2)) - val(dtos(date1))) / 10000)
This will give the total elapsed years; for example, if your age is 33.99, it will be truncated to 33.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform