Is there any built-in function to calculate months different from two dates? 

Example: I want to know how many months is from 31th December 2019 substract 10th September 2019.

Or should I just use DiffDays then divide the result with 30?

Solution

Hi,

No it is not a build in function, also your suggestions are not correctly calculating the number of months.

Try

(Year(enddate)*12 + month(enddate)) - (Year(startdate)*12 + month(startdate))

Regards,

Daniel



Solution

Thanks Daniel

Your welcome, you better calculate it in a server action with startdate and enddate as input parameters and number of months as an output parameter, so you can easily reuse it. Don't forget to set the Is function property to true so that you can use the server action in expressions.