Skip 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.

Age Calculation

Featured Replies

I already have the calculation for age but I want the calculation to appear in months instead of years so that I can figure out Vacation Time. Example:

Current Date = field 1

Date of Hire = field 2

Total Months = field 3 (Calculation that I can't figure out)

Vacation = field 4 (calculation = vacation *.875) in months

Thanks in advance for all your help

Try this:

Case(

not IsEmpty(Current Date) and not IsEmpty(Date of Hire) and (Current Date >= Date of Hire) ;

12 * (Year(Current Date) - Year(Date of Hire) - ( Current Date < Date( Month(Date of Hire) ; Day(Date of Hire) ; Year(Current Date) ) ) ) + (Mod( Month(Current Date) - Month(Date of Hire) + 12 - ( Day(Current Date) < Day(Date of Hire) ) ; 12 ) )

)

  • Author

Thanks Ralph, will try it and let you know.

  • Author

Ralph,

I tried it and when I put in the current date of 06/01/2000, it comes up 47 months. That is about 6 months short. There has to be a way. I copied exactly the calcuation and pasted it into the field and that's what I got.

I get 55 months with the calculation copied from the post and pasted into FMP. 6/1/2000 to 1/1/2001 is 7 months. 1/1/2001 to 1/1/2005 is 4 years = 48 months. 48 + 7 = 55.

6/1/2000 is Date of Hire & Current Date is 1/19/2005.

  • Author

I must have something else wrong then. I keep coming up with 47 with the exact same script. Like I said, I cut and pasted it into the field and that is what I get. Will look at it again.

How are you getting the Current Date? I used Get ( CurrentDate ).

  • Author

That is what I was using also but when I put in the field to show up the current date is was 8 months. I deleted the field and put it back in and it is now working perfectly. I guess that it was just some sort of bug. Not sure what was going on with this as it has happened before with other dates. Thanks Ralph. Your calculation did work in the first place. I should have checked into this first.

Have you set the current date to be unstored? It needs to be unstored or it will remain at the date the record was created.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.