My client wants me to write a formula field to return the duration(in months and days) between two date fields.
- If start date is "January 1st 2016" and end date as "December 31st 2016" then it should return value as "12".
- If start date is "January 1st 2016" and end date as "November 20th 2016" then it should return value as "11.67".
From the sample formulas given on the salesforce documentation, I see that there is a formula
date_1 — date_2 to calculate number of days between two dates.
But should I update the formula to
(date_1 — date_2)/30 or
(date_1 — date_2)/31 to get what I need?
Is this something really doable using formula or am I better off solving this using Apex?