Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reliably getting age from DOB and DATE()
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Reliably getting age from DOB and DATE()
Miscellaneous
Thread ID:
00586710
Message ID:
00586710
Views:
43
I have run into an interesting issue. We have been using the following line for some time to give the age of a person.
ALLTRIM(STR(INT((DATE()-This.Value)/365.25)))
However, on the birthday, on many years it's off by one day (wrong value on the birthday, but correct the next day).

Is there an easy way to always get the age right with a single line of code? If not, what block of code would it take to accomplish this?
Cy Welch
Senior Programmer/Analyst
MetSYS Inc
Next
Reply
Map
View

Click here to load this message in the networking platform