Hi
I want to Calculate the date difference in to Months and years
form given dates
date1: 15 Jan 2022
date2: 15 Jan 2024
date2-date1
ANS= 2 years
In Appian date difference
date2-date1 is calculating only days
730
Discussion posts and replies are publicly visible
Divide it by 365?
tointeger(date(2024,1,15)-date(2022,1,15))/365
Hi tejas_n
There isn't any OOTB functionality to achieve your requirement , But you can use elapsed Years or elapsed Months functions which are available in "DATE AND TIME UTILITIES". Plugin . Or you can write your own mathematical calculations.
Take a look at this plugin: community.appian.com/.../date-and-time-utilities
a!localVariables( local!months: elapsedMonths(ri!date2, ri!date1) - ri!gapInMonths, if( local!months > 12, a!localVariables( local!month: mod(local!months, 12), local!years: quotient(local!months, 12), local!years & " Years " & local!month & " Months" ), local!months & " Months" ) )