I have records that have a start date, end date, and funding for a year rate. I am trying to write a formula that will read how long the record was active in months and give me the rate for that period. The only thing is, if the start date happens on the second to last day of the month, it will still count as a full month. And if the end date isn't the last day of the month, then that month doesn't count at all.
For example Start Date = 2023-09-23, End Date = 2024-01-28, Rate = $20,000
The months would need to equal 4 since it started in September and didn't go until the end of January and the rate would need to be $6,666.67
I have been trying to make the age_months and timestamp_diff(month functions work, but it does not come up with the months correctly.
Any pointers?