Solved How extract the remaining years, months and days before compulsory retirement date

Kamayo Ako

Member
Local time
Today, 13:35
Joined
May 23, 2022
Messages
92
Have a goodday to all!!!

I just want to ask your assistance again on how to extract the remaining years, months and days before compulsory retirement date. Attached the sample database for the concern transaction.

Thank you so much in advance.....
 

Attachments

  • RETIREMENT.zip
    RETIREMENT.zip
    765.1 KB · Views: 158
  • EXTRACT REMAINING DAYS.PNG
    EXTRACT REMAINING DAYS.PNG
    13.4 KB · Views: 94
Then you will have to post in detail here exactly what you did!

Remember, we can not see your screen or what you do, so it is impossible to know how to help you unless you tell us exactly what steps you have followed.
 
Then you will have to post in detail here exactly what you did!

Remember, we can not see your screen or what you do, so it is impossible to know how to help you unless you tell us exactly what steps you have followed.

I just reverse the CalcAge Functions and i use ABS function to avoid negative result




Public Function CalcRetirement(dteCRD As Date, Optional dteEnd As Date) As String

'years, months & days
Dim intyears As Integer, intmonths As Integer, intdays As Integer

'If no end date absolute retirement, use current date as default
If Nz(dteEnd, 0) = 0 Then dteEnd = Date

intmonths = DateDiff("m", dteCRD, dteEnd)
intdays = DateDiff("d", DateAdd("m", intmonths, dteCRD), dteEnd)

If intdays < 0 Then
intmonths = intmonths - 1
intdays = DateDiff("d", DateAdd("m", intmonths, dteCRD), dteEnd)
End If

intyears = intmonths \ 12
intmonths = intmonths Mod 12

CalcRetirement = Abs(intyears) & " Years, " & Abs(intmonths) & " Months And " & intdays & " Days"



End Function
 
here test your retirement. check the calculation if it is correct (using fnTotalSvc, module basAge).
 

Attachments

here test your retirement. check the calculation if it is correct (using fnTotalSvc, module basAge).
Sir may may additional na concern ako. Duon sa pag calculate ng Compulsory Retirement date. yung Exact Retirement Date after 56 years old.

Halimbawa birthdate ko is : 06 Jun 1990 + 56 = 06 June 2046 is my Compulsory Retirement Date ang lumabas kasi sa akin sir is 23 May 2046 calculated field kasi ginamit ko [Birthdate]+(56*365) =Compulsory Retirement Date


Maraming Salamat ulit sir.
 

Attachments

  • EXTRACT REMAINING DAYS.PNG
    EXTRACT REMAINING DAYS.PNG
    13.4 KB · Views: 101

Users who are viewing this thread

Back
Top Bottom