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

Featured Replies

Attached is a fairly simple way to search for people by age using multikey relationships. I needed a way to do this in an application I am working on as my users will not be bright enough to work out the dates themselves. Originally I simply multiplied the age number by 365.24 and subtracted from the date but was not entirely happy with the results. The tricky part was working around leap years and different system settings. The attached calculations should work regardless of the system setings and occurances of Feb 29. If the multikey is required to fall on Feb 29 for a year that has no leap year it is changed to Feb 28. The calculation is designed to find real people by age so it limits the max range from 1/1/1800 to 1/1/4000 (filemakers max date). I have referenced the test date field so you can see how it performs around leap years by changing the date. For real world use change all references to the test date field with Get( CurrentDate ). It took me a couple of hours to get the calculations to function properly and there may well be an easier way but it is here if anybody wishes to use it.

Dates.zip

there may well be an easier way

Yes, there is. And there is no need to limit the range.

Dates.fp7.zip

  • Author

Comment,

I certainly found the long way around, didn't I. I never even considered that FM would automatically go to 1/3 if 29/2 did not exist. I assumed it would produce an invalid date and an error. I will leave the limit dates as these are two of 17 multi key fields and they should not be required to contain data to show records in the portal. I imagine FM will have a new version by 4000!

For the record, FMP's date engine calendar thingy goes to the year 3000, not 4000.

  • Author

Vaughan,

The application FM7.3, I am using will allow me to use date years from 1 to 4000 but not 4001.

Yes, the Date() function is very powerful because of that, and calculations that are seemingly complex can be made very simply, e.g. Date ( Month + 1 ; 0 ; Year ) returns the last day of the Month in that Year.

Vaughan, version 7 added another millennium and goes up to Dec 31, 4000.

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.