afh2006 Posted September 1, 2006 Posted September 1, 2006 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
Ender Posted September 1, 2006 Posted September 1, 2006 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?
John Mark Osborne Posted September 1, 2006 Posted September 1, 2006 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//
afh2006 Posted September 1, 2006 Author Posted September 1, 2006 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.
comment Posted September 1, 2006 Posted September 1, 2006 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
Recommended Posts
This topic is 6720 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now