Hi,
I'm attempting to take a duration between two dates and parse that duration out into months and days.
I'm using these formulas, which are nearly precise except when the dates cross July and August. I'm assuming because those two months are 31 days each.
This is [Duration in Months]:
DateTimeDiff([End Date],[Start Date],"months")
This is [and days duration]
round(DateTimeDiff([End Date],[Start Date],"days")-([Duration of contract in months]*30.5),1)
I rounded up the average number of days in a month from 30.4166666 to 30.5. and am rounding up the whole equation. But when the dates cross over July and August, a day gets dropped.
Is there a more precise method to getting exact days that are the remainder after the number of months have been calculated?
thanks
Chris
Solved! Go to Solution.
Use DateTimeToday() as opposed to DateTimeNow(). DateTimeToday returns today's date with no time. DateTimeNow() returns a DateTime object that includes the current time, so the date calculations are thrown off by 1 day
Dan