John,

To work out the number of months between 2 dates, use this logic instead :

( ( Year ( End Date ) * 12 ) + Month ( End Date ) ) -
( ( Year ( Start Date ) * 12 ) + Month ( Start Date ) )

Don't forget to add or subtract one to either include or exclude the start and finish date. Is that what you were after?

Cheers,
Nick


On 05/06/2007, at 11:56 AM, John Wenmeekers wrote:

I need to know (calculate) which month(s) and how many times they are in a
given time range.

I have dateStart and dateEnd as field.

Out of those two I can generate a ΒΆ list (text) of days between dateStart and
dateEnd.

Parsing out the first date from that field I can calculate the last day of that month, which gives me the 'first month'. (and how many days between the start date and the end of that month, just in case somebody should ask for it
in the future...)

The same cluncky logic goes for the last date in the range.

Now I have two months...and stuck for the in between part.

I'm thinking to use a recursive custom function.
The 50 000 limit could not be a problem, there will be never 136 years
between dateStart and dateEnd.

Any hints how to tackle this one ?

TIA

Reply via email to