Number of Months
Posted: Mon Nov 14, 2011 10:42 am
I'm trying to figure out a way to count the number of months between two dates, but with a slight difference. I want to count just the months including the beginning and ending month, not the actual time period between them.
For example, if I have a starting date of 4/30/2011 and an ending date of 7/25/2011 I want to return 4 months (April, May, June and July) rather than a calculation based on 86 days.
If I have a starting date of 10/30/2010 and an ending date of 11/05/2011 I want to return 14 (Oct, Nov, Dec, Jan, Feb, Mar, April, May, June, July, Aug, Sept, Oct, Nov) rather than a calculation based on 371 days.
Thanks
For example, if I have a starting date of 4/30/2011 and an ending date of 7/25/2011 I want to return 4 months (April, May, June and July) rather than a calculation based on 86 days.
If I have a starting date of 10/30/2010 and an ending date of 11/05/2011 I want to return 14 (Oct, Nov, Dec, Jan, Feb, Mar, April, May, June, July, Aug, Sept, Oct, Nov) rather than a calculation based on 371 days.
Thanks