R
RH
Hi,
I would like to calculate the number of years between 2 dates. I tried
using the DateDiff function but I don't get the result that I want. MSDN
says:
If Interval is set to DateInterval.Year, the return value is calculated
purely from the year parts of Date1 and Date2.
I would like the function to consider all of the components of the date (not
just the year portion). I have thought about just getting the number of days
and dividing by 365 but I know I would have to account for leap years.
Any suggestions? Thanks in advance.
I would like to calculate the number of years between 2 dates. I tried
using the DateDiff function but I don't get the result that I want. MSDN
says:
If Interval is set to DateInterval.Year, the return value is calculated
purely from the year parts of Date1 and Date2.
I would like the function to consider all of the components of the date (not
just the year portion). I have thought about just getting the number of days
and dividing by 365 but I know I would have to account for leap years.
Any suggestions? Thanks in advance.