AnsweredAssumed Answered

how many months between two dates

Question asked by lpnoires on Jan 9, 2012
Latest reply on Jan 9, 2012 by LaRetta_1

Title

how many months between two dates

Post

 Hello All, Hello Phil,

I need to know how many months, if any, are included in a period of two dates, date1 and date2.

The formula I'm using as follows :

12 * ( Year ( date2 ) - Year ( date1) ) + Month ( date2) - Month ( date1) - ( Day ( date2) < Day ( date1) )

which gives me 1 month for the following dates : 01/01/2012 and 01/02/2012 . Ok.

But  0 month for 01/01/2012 and 31/01/2012.

Haven't been successfull yet trying to come up whith a valid formula.

Could you help ? Thanks in advance !

Outcomes