iepaul
asked on
calculate number of days in each month between two dates
How would I calculate the number of days in each month between two dates in vb.net?
Example: Given start date of 12/09/2010 and end date 07/11/2010 I would like to get back
09/2010 - 22 days
10/2010 - 31 days
11/2010 - 7 days
I am not to worried by the exact out format as long as I can distinguish between the months.
The start and end dates vary and could possibly be in the same month or across two months or even more.
Example: Given start date of 12/09/2010 and end date 07/11/2010 I would like to get back
09/2010 - 22 days
10/2010 - 31 days
11/2010 - 7 days
I am not to worried by the exact out format as long as I can distinguish between the months.
The start and end dates vary and could possibly be in the same month or across two months or even more.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You need to use DateDiff() function:
http://msdn.microsoft.com/en-us/library/b5xbyt6f(v=vs.80).aspx
http://msdn.microsoft.com/en-us/library/b5xbyt6f(v=vs.80).aspx
ASKER
great answer
Open in new window