Jump to content

This topic is 8254 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Please advise proper method for calclating the "time in service" in years, months and days for an employee. Taking into consideration any leap year days. I can arrive at the number of "days" by using the Date2 -Date1, but need to display years, moths and days

Thx

Posted

Without getting into the actual calculations, I think that you need to break the dates up into thier composite part and compare then seperately. (i.e. Year2 - Year1, Month2 - Month1, Day2 - Day1)

Posted

This will give you a text field of years, months and days.; based on a StartDate field and today.

HowLong =

NumToText(Year(Status(CurrentDate)) - Year(StartDate) - If(Status(CurrentDate) < Date(Month(StartDate), Day(StartDate), Year(Status(CurrentDate))), 1, 0)) & " Years, " & NumToText(Mod(Month(Status(CurrentDate)) - Month(StartDate) + 12 - If(Day(Status(CurrentDate)) < Day(StartDate), 1, 0), 12)) & " Months, " & NumToText(Day(Status(CurrentDate)) - Day(StartDate) + If(Day(Status(CurrentDate)) >= Day(StartDate), 0, If(Day(Status(CurrentDate) -

Day(Status(CurrentDate))) < Day(StartDate), Day(StartDate), Day(Status(CurrentDate) - Day(Status(CurrentDate)))))) & " Days"

This topic is 8254 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.