Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to group this?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00460146
Message ID:
00497677
Views:
9
Glad you got an answer before I got here :-)

>Barbara,
>What formula did you use to calculate age? I'm actually trying to calculate age for a given date of service and I come up with incorrect age calculations due to leap years. E.g. INT({^2001/03/04} -{1968/03/05}/365.25) correctly calculates the service date age at 32, however, INT({^2001/03/05} -{1968/03/05}/365.25) incorrectly shows as 32. Can't use rounding b/c the day prior to the birthday would incorrectly show as 33. I have emperically tested different combinations of leap year/non-leap year for every month and correction factors are needed for about 25% of the combinations. It sure would be nice to clean up that code.
>
>TIA
>JR
>
>>John,
>>Add a field to the SELECT that contains int(age/10)*10. This will give you the number of complete decades (if the person is 30-39 it'll show '30', etc.).
>>
>>HTH
>>Barbara
>>
>>>Hi,
>>> I have member.birthday field in my table. I get the formula to calculate members' age. How should I group them base on their age such as 10, 20, 30, and ...?
>>>
>>>Thank you
Barbara Paltiel, Paltiel Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform