
Hi, how are you all doing? Hope you are all doing great.
I am looking for a ssrs expression to calculate date duration between two dates into Years, Months and Days.
For example, we have two dates:
StartDate: 3/1/2019
EndDate: 10/5/2021
Duration: EndDate - StartDate
Duration should print ==> 2 Years, 7 Months, 4 days
I'm trying this expression:
=Floor(DateDiff("m",Fields!StartDate.Value,Fields!EndDate.Value)/12).ToString()+" Years, " +(DateDiff("m",Fields!StartDate.Value,Fields!EndDate.Value)-(Floor(DateDiff("m",Fields!StartDate.Value,Fields!EndDate.Value)/12)*12)).ToString()+ " Months"
This expression returns 2 Years, 7 Months
This expression is working fine for Years and months. Anyone who can please help me in extending this expression to calculate remaining days which are 4 in the above example.
Thanks for reading.
Hello,
We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist. If you need assistance with debugging or coding I would recommend discussing this on one of our communities.
www.yammer.com/dynamicsnavdev
dynamicsuser.net/.../developers
I will open this up to the community in case they have something to add.
Thanks