James Cochrane
asked on
DateDiff different than MS Excel
I am using the following routine:
Microsoft.VisualBasic.Date AndTime.Da teDiff(Int erval, startDate, endDate, Microsoft.VisualBasic.Firs tDayOfWeek .System, Microsoft.VisualBasic.Firs tWeekOfYea r.System);
This gives me the difference in dates. I use the following dates:
When I use the function with startDate = 11/09/2006 and endDate = 2/09/2007 the result is 92 days.
When I use the function with startDate = 11/16/2006 and endDate = 2/09/2007 the result is 84 days.
However, in MS-Excel, when I take the difference between the sets of dates for the first one the difference is 92 days.
for the second one the difference is 84 days. I tried simply subtracting the dates in C# as well and the result is still diffferent for the second set.
Thanks
Microsoft.VisualBasic.Date
This gives me the difference in dates. I use the following dates:
When I use the function with startDate = 11/09/2006 and endDate = 2/09/2007 the result is 92 days.
When I use the function with startDate = 11/16/2006 and endDate = 2/09/2007 the result is 84 days.
However, in MS-Excel, when I take the difference between the sets of dates for the first one the difference is 92 days.
for the second one the difference is 84 days. I tried simply subtracting the dates in C# as well and the result is still diffferent for the second set.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://office.microsoft.com/en-us/excel/HP052090471033.aspx
Fernando