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.

What is wrong with my age calculation?????

Featured Replies

I'm using the age calculation:

NumToText(Year(Today) - Year(DOB) - If(Today<Date(Month(DOB),Day(DOB),Year(Today)), 1, 0))&"Years,"&NumToText(Mod(Month(Today) - Month(DOB) + 12 - If(Day(Today) < Day(DOB), 1, 0), 12))&"Month,"&NumToText(Day(Today) - Day(DOB) + If(Day(Today) >=Day(DOB), 0,If(Day(Today- Day(Today)) < Day(DOB),Day(DOB),Day(Today- Day(Today)))))&"Days"

I copied it from a post I found searching here on the boards. First of all, I'm getting the wrong result. From the birthdate '4/15/1973' I'm getting '2003years,2months,27days'. Not only that, but it's not different for every record, it uses the same result for every record in my client file. WTF??? I have the calculation using the 'DOB' date field. Could I be having problems because the dates are entered in MM/DD/YYYY format???

'2003years,2months,27days' is exactally today's date so..

DOB is empty because it is not a date field or 'cause it comes from relationship that is not activated.

DJ

Hi ddreese,

Using this format of the date 4/15/1973, the result using the calculation above is:

29Years,10Month,12Days

HTH

Lee

smile.gif

smile.gif

Use the Status(CurrentDate) function instead of the Today function and make the calculation unstored. This might not solve your current problem but it will fix the one you're going have sooner or later!

Todat only relaculates whenever the file is opened. If you host the file on a FM server or leave the file open more then 24 hours (or just across the mignight changeover) the calculation will be incorrect. It won't recalculate until you close and reopen the database.

Status(CurrentDate) has no such limitations.

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.