Number of Months

Stimulsoft Reports.NET discussion
Post Reply
MikeC
Posts: 51
Joined: Mon Jun 07, 2010 3:36 pm

Number of Months

Post 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
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Number of Months

Post 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.
Post Reply