Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculate Value.

Hello Team,

I am facing issue while calculating the time period. The calculation will be like when I select the Insurance number the related service period should be display like 6 years 7 months and 3 days.

Ex: Insurance No 3: 

CompanyName  StartDate          End Date

AAA                    18/09/2014       21/09/2015

BBB                    25/10/2015        30/11/2016

CCC                    07/12/2016       18/07/2017

   If I select Insurence number 3 the number of years of service will be like: 3 years 4 months and 7 days.

While calculating if total months crossed 12 then year value should be increase and days crossed 30 or 31 then month value should be increase.

Could you please help to resolve this issue.

Regards,

Ram

2 Replies
Anil_Babu_Samineni

Same issue Difference between two dates in Year,Month and Days

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
shraddha_g
Partner - Master III
Partner - Master III

Try

if(div(date(EndDate)-date(StartDate),365) >0,div(date(EndDate)-date(StartDate),365) & ' Years ')

&  if(div(mod(date(EndDate)-date(StartDate),365),30) >0,div(mod(date(EndDate)-date(StartDate),365),30) & ' Months ') &

if(mod(mod(date(EndDate)-date(StartDate),365),30)>0, mod(mod(date(EndDate)-date(StartDate),365),30) & ' Days')