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.

Help with a date script

Featured Replies

I am trying to write a script that will calculate the difference between a date enter into a date field and the current date then return the result as a text string (Xyrs Xmos). I cannot get the month part to calculate correctly because the months do not occur in the same year always.

Example:

9-1-03 comparison date

11-1-04 current date

1yrs 2mos desired result

1-1-04 comparison date

11-1-04 current date

0yrs 10mos desired result

I am new to scripting in filemaker but not to scripting in general but have never work with dates before.

Any help is greatly appreciated.

-REM

Unstored calculation field:

Let ( [ diff = second_date - first_date ] ;

( Month(diff) - 1) & " mos " & Day(diff) & " days " & (Year(diff) -1 ) & " yrs"

)

  • Author

Thank you that is prefect. Is there a good reference for scripting?

For intermediate level programming, see Learn FileMaker 7. For advanced programming, see Using FileMaker 7.

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.