Page 1 of 1

Number of Months

Posted: Mon Nov 14, 2011 10:42 am
by MikeC
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

Number of Months

Posted: Tue Nov 15, 2011 2:42 am
by HighAley
Hello.
MikeC wrote: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.
We have no such specific function. You can write your own function and use it.

Thank you.