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 field

Featured Replies

I have my patients database, with one of the fields is "age", of course.

For young patients, I would like to enter the age in this format: "5m"; "10d"; "2y 3m", and yet, theses entries need to be calculated, internally as decimal numbers when I do my statistics.

Currently i calculate the number manually and enter it as a decimal number i.e. 5 months = 5/12 = 0.42, which is cumbersome for the secretaries and it does not look harmonious when printing the record of the patient.

Please help.

I think your best option would be to enter their birthday, then let their age be a calculated field. If you did it this way, the age calculated field could be formatted however you'd like on reports. For example:


Let(

age = TransactionDate-Birthday;

Case(

    age < 365 ;  // less than one year

    age / 12 & "m";

ect...

))

The only other way I can think of doing this is by using a Custom Function or script triggers, which you don't have in FileMaker 9. Both of those methods are more complicated though.

  • Author

The DOB is a very good idea; however, it is not available most of the time. Your calculation seems to do part of the job. If you can please complete the calculation for me to show age in years only for ages > 5; to show years and months for ages 1-5 years; and to show months and days for < 1 year of age.

For example entering 11/21/2000, should show "10y"

Entering 1/1/2003 should show: "7y 11m"

Entering 2/2/2010 should show: "9m 18d"

Thanks again

You need to define "month". A child born on Feb 1, could be one month old on Mar 1. By the same logic, a child born on Mar 1, would become a month old on Apr 1. Thus you have 28 days = 1 month, and 31 days = 1 month.

Using another system (perhaps better suited to pediatrics) a child would become one month old when 30 days have elapsed since its birth.

  • Author

In statistics, a month equals 30 days. I have no problem with that.

Try =


Let ( [

n = VisitDate - DOB + 1;

y = Div ( n ; 365.2425 ) ;

r = Mod ( n ; 365.2425 ) ;

m = Div ( r ; 30.436875 ) ;

d = Round ( Mod ( r ; 30.436875 ) ; 0 )

] ;

Trim ( Case ( y ; y & "y ") & Case ( y < 5 ; m & "m " ) & Case ( y < 1 ; d & "d" ) )

)

  • Author

dear comment,

Very nicely done. I'm so grateful.

I have two questions:

Is there a problem not adding one day to age.

Secondly, as far as searching this field, would it be possible to find patients by age range?

Is there a problem not adding one day to age.

No, and it would probably be better for this type of usage.

as far as searching this field, would it be possible to find patients by age range?

I think it would be awkward. I would split the calculation into two: have a field that return the number of elapsed days, and another that formats this as shown above. Then translate your criteria into a range of days and search the first field.

  • Author

That is great. Thanks again.

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.