AnsweredAssumed Answered

Calculation of days

Question asked by bruns on Apr 20, 2015
Latest reply on Apr 21, 2015 by philmodjunk

Title

Calculation of days

Post

Hello, I have 2 fields c_tenure and cTenure_combined.

 

cTenure

Let (span = Get ( CurrentDate ) - Date Hire;(Year  (span)) - 1  &  "yrs" & (Month  (Span))  - 1 & "mos"  & (Day (span) ) - 1  & "days")

 

cTenure_combined

Let ( [ d = cTotal_cTenure_days ;
           mc = Div ( d ; 30 ) ; // number of months to "carry" over to the months total.
           m = cTotal_cTenure_months + mc ;
           yc = Div ( m ; 12 ) ; // number of years to "carry" over
           y = cTotal_cTenure_years + yc
          ] ;
          y & " years " & Mod ( m ; 12 ) & " months " &  Mod ( d ; 30 )  &" days"
        )

 

Both of these work perfectely as they are but now I would like to total these 2 fields into a cTenure_grand_total field.  I can add the 2 fields but the resluts are not in the years, months and days like the other 2 fields, can someone please help with a calc to add these 2 where the field cTenure_grand_total read ? years ?Mos ?Days.

 

Any help is appreciated.

Capture.PNG

Outcomes