Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is best way to calculate age
Message
From
20/09/2006 12:51:14
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01155605
Message ID:
01155634
Views:
44
>We need totals of clients by age bracket. What is the best way to calculate the age? Right now, we are using:
>
>INT((DATE() - a.dob) / 365)
>
>But that doesn't take into consideration leap years (which could be significant for someone over 90 years old). Any suggestions? Should I just use:
>
>INT((DATE() - a.dob) / 365.25)
>
>Or is there a better (more accurate) way?
>
>Thanks,
>Doug

if YEAR is enought:
YEAR(DATE())-YEAR(a.dob)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform