If I understand the problem correctly, you will be getting a total for days, months and years.
I would look at days, and if the number is greater than 30, divide the number by 30 and truncate the result to give the number of months, and the take the number of days % 30 to get the remaining days. You can then do the same thing with the months i.e. if greater than 12, divide by 12 truncate the fractional part of the answer, and add to years, and then use the mod function to determine the number of months remaining, or alternatively, subtract the number of new years added * 12 from the original number of months.
Mike
EchoVue.com
|