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

Hello,

I searched the forum but cannot find any notes on how to calculate a person's age based on his/her birthdate. I also cannot find this in any of the documentation I have which is surprising as I thought this particular calculation would be very commonly used. How would I do this?

Thanks!

rlbryant

See my previous post.

What previous post?

It is helpful to Post the URL to whatever post you are referring to.

Lee

Year(Get(CurrentDate)) - Year(DOB) - (Get(CurrentDate)< Date(Month(DOB); Day(DOB); Year(Get(CurrentDate))))

Stick with Queue's calculation, tranpower's has flaws. As almost all attemps at this calculation have.

Truncate((Get(CurrentDate)-birthdate)/365.25;0)

That one doesn't work if you were born between the first and twenty-eighth of February during a non-leap year and today is your birthday.

Ralph: Please provide one or more counterexamples to the function I gave, if you can, so we can all learn.

  • Author

Thank you very much to everyone who responded. I have this working now in a test system.

rlbryant

I have this equation and it does work, when you are typing in for the frist time... But I have noticed that the age does not change when a birthday passes. Have I done something wrong?

Joseph

The calculation needs to be "Unstored".

That is an option provide in the Calculation Window (at least it was in v6 and before).

Lee cool.gif

Great I will try this thank you....

Ok, I went into the calc, under storage options and marked do not store anything... But the age did not change? How do I go back through the data base and refresh all for the age?

Thank you for the help,

Joseph

Joseph, is your field a date field, number field or calculation? I think you have it set to either a date type field or a number, then you are putting that calculation in the "auto-enter" area. Change the field type to a calculation.

Thank you for the response... My Field is a calc...

frown.gif

Thank you

Joseph

At the bottom there is a menu that defaults to number. Change it to Date and see that does it for you.

The answer is a truncated 2 digit age -- like 71... it is generated by this equation:

Case(IsEmpty(Ins_DOB);"";Truncate((Current_Date-Ins_DOB)/365.25;0))

Any idea's?

Joseph

Use the calc I posted already. It is more accurate and no truncating is necessary.

Ok, so I now am using your equation Queue:

Year(Get(CurrentDate)) - Year(DOB) - (Get(CurrentDate)< Date(Month(DOB); Day(DOB); Year(Get(CurrentDate))))

On my form this is a calc and a number... Does this mean that the age will increase when his birthday passes?

Thank you for the help

Joseph

  • Newbies

How do I calculate Age from a Date of Birth field and a Date of Death field - ie not using current date

Use Date of Death instead of Get(CurrentDate).

I believe this calculation can be stored. tongue.gif

  • Newbies

Hi, I am trying to work with the code that is being given here and I haven't had success in making it work.

I have a field that calculates the equation that was given by the user Queue

but I cannot modify the field when I create a record so I do not know how I am suppose to pass a date in order for the calculation to render the number for age.

The field which type is Calculation has the equation:

Year(Get(CurrentDate)) - Year(DOB) - (Get(CurrentDate)< Date(Month(DOB); Day(DOB); Year(Get(CurrentDate))))

Calculation result is number

The above is not working.

I've also tried to make the field type number, with the Auto Enter Calculate checked which to I then place the equation which allows me to modify the field, but then the calculation is wrong.

Any ideas?

DOB is the Date of Birth field. Once you fill that in, there is no need to pass a date since it naturally passes itself. Calculation fields are not intended to be modified, nor is there any reason to do so in this case.

Make sure the calculation is unstored in Storage Options (select 'Do not store calculation results') or the field will not update when the date on your system changes.

What is the formula for calculation of age in months instead of years?

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.