>Hi All,
>
>Is there a sample code that will calculate the number of years, months and days given a total number of days?
>
>Example. 365 days -> 1 year, 0 month and 0 day
>650 days -> 1 year, 9 months & ~11 days
The most elegant way I have seen to get an integer number of years is something like this:
? int((val(dtos(date1)) - val(dtos(date2))) / 10000)
Perhaps you can adapt to month calculation, and then divide by 12 to get years.
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)