function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
pauldes1pauldes1 

Calculate number of months between 2 dates

Is this possible? Trying to subtract the smaller date from the larger date, then divide by 30 to get the approximate number of months between 2 dates. Can't figure out how to convert the date value to an integer to do this....or is there another way completely?
Paul.FoxPaul.Fox
When you subtract two dates it will return the number of days between the dates.  For example: (NOW()- {!CreatedDate})/30.5  will give the number of months.
StefanStefan

Just in case anyone is searching for a solution, this works for me

 

(Year( CloseDate ) * 12 + Month(CloseDate)) - (Year(  TODAY() ) * 12 + Month( TODAY() ))

jd123jd123

HI Stefan

 

         if i am giving Close date is 5/31/2012 and suppose today date is 6/01/2012 then it is giving 1months.Here Actually the differance is only one day but it is giving 1months

 

 would you please right Round function and send to me.

 

Thanks

JD123.

StefanStefan

I doubt you will get an answer tagging your question on to a very old post!

 

Suggest you start a new post!

 

If you just want the number of days then something like Today - CloseDate