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

difference b/w two dates

Featured Replies

this seems like it should be simple but has had me stumped. i'm trying to get the numeric difference, in days or months, of the difference between two dates. one of these date fields will always be later than the other. when i set it up as "datelater - dateearlier" and output to number, then i get fairly accurate results if the difference is a year or two. but i'm doing a longterm medical study and the differences are often 15 to 25 years and filemaker is returning numbers that are usually way off (though, even in this range, they are sometimes almost accurate). what's going on and how do i fix this?

andrew

Your calc, 'datelater - dateearlier' will return the number of days between them, even when they span many years. Perhaps you're trying to convert the result to months or years?

I think the formula on this thread will help you create the solution you are looking for:

http://fmforums.com/forum/showtopic.php?tid/179924/post/220204/hl//

  • Author

for dateearlier=9/15/86 and datelater=2/1/05 i come up with 6705 days (365/yr, 30/mo) plus 5 days for leap years makes it 6710. the datelater - dateearlier calc comes up with 6714 days. i can't account for the 4 days.

The problem is not with Filemaker, but with your control calculation.

From 9/15/1986 to end of the month: 16 days;

Oct 1986: 31 days;

Nov 1986: 30 days;

Dec 1986: 31 days;

1987 - 2004 (incl.): 18 years;

5 leap years (1988, 1992, 1996, 2000, 2004 );

Jan 2005: 31 days

16 + 31 + 30 + 31 + 18*365 + 5 + 31 = 6714

  • Author

you're absolutely right. thanks.

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.