I always have trouble in date calculation. Let’s an employee join a compay June 1, 2022. The total service years until the currnet date, today(), August 8, 2023 is
As mentioned earlier, it will be a complex expression and not a straightforward based on existing AppSheet functions, especially if you are looking for precise number of months and days.
Yes, as @SkrOYC also mentioned , the nice tip shared by him will give result in years and months and not days. Also it considers number of days in a year as 365. Every 4 years leap year is there with 366 days. So any calculation around leap year even if calculated for 1 or 2 years will add an error. Also months have 28, 29, 30 or 31 days. The expression in the tip considers each month of 365/12 that is 30.41 days.
So as @SkrOYC also rightly guided it will be an approximate calculation.
From your question it sounded that you are calculating it for a service tenure and and as such needs to be precise and hence we( @SkrOYC and I) mentioned on approximation with available technique and need of a complex expression for precise results,
Thank you. I take this is acceptable FLOOR(HOUR(TODAY()-[DATE JOIN])/365.25/24)&" YEAR “&
FLOOR(MOD((HOUR(TODAY()-[DATE JOIN])/24),365.25)*12/365) & " MONTH”
I actually suggest you to check the whole thread since @Steve added a neat expression to get a more accurate Days portion. That’s also why I added a link to the OP