Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Hi there,

I am developing an HR system. I have a field that calculates the employee's employment age in the following format: "1 day, 1 month, 1 year":

"GetAsText ( Year ( Get ( CurrentDate ) )  - Year ( First date of employment ) - If ( Get ( CurrentDate ) <  Date ( Month ( First date of employment ) ; Day ( First date of employment ) ; Year ( Get ( CurrentDate ) ) ) ; 1 ; 0 ) ) & " Years, " & GetAsText ( Mod ( Month ( Get ( CurrentDate ) ) - Month ( First date of employment ) + 12 - If ( Day ( Get ( CurrentDate ) ) < Day ( First date of employment ) ; 1 ; 0 ) ; 12 ) ) & " Months, " & GetAsText ( Day ( Get ( CurrentDate ) ) - Day ( First date of employment )  + If ( Day ( Get ( CurrentDate ) )  ≥ Day ( First date of employment ); 0 ; If ( Day ( Get ( CurrentDate ) - Day ( Get ( CurrentDate ) ) ) < Day ( First date of employment ) ; Day ( First date of employment ) ; Day ( Get ( CurrentDate ) - Day ( Get ( CurrentDate ) ) ) ) ) ) & " Days "

I also have a field for the date an employee ends their employment. I have tried several approaches but cannot get a solution working that will take into account the end date and halt this calculation where an "end date" has been entered.

Any ideas are gratefully received.

Best regards,

Tim

Did you leave something off,like a Case Statement, or Let Statement?

There are several Elapse and Age Custom Functions at Brian Dunning’s site here http://www.briandunning.com/filemaker-custom-functions/recentlist.php

Elapse days is not exact.

39 minutes ago, topazmedia said:

I also have a field for the date an employee ends their employment.

What do you want this to show? Elapse days from hire to end of employment?

There is also one here https://community.filemaker.com/thread/147929 that the poster claims accounts for February?

 

  • Author

Thank you for the reponse and link Lee. I'll check it out.

The field for the end date of employment is for entering their last actual day of employment. Upon entering a date into this field I want the employment age field to halt based on that date.

Best regards,

Tim

Your question seems to be the same thing.

The first one seems to be asking for a calculate to just know how long they employee has been with the company? i.e. such as anniversaries?

The second one seems to be just calculation how many days, months and years they work for the company? 

On 04/01/2016 at 7:09 AM, topazmedia said:

a solution working that will take into account the end date and halt this calculation where an "end date" has been entered.

Start your calculation with:

Let ( [
end = If ( EndDate ; EndDate ; Get ( CurrentDate ) ;

then use the end variable instead of Get (CurrentDate) in your formula.

Note:
I have not gone over your formula. If you check previous posts on the subject, you will see I have repeatedly advised against calculations that try to express a duration in years, months and days.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.