September 1, 200619 yr 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
September 1, 200619 yr 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?
September 1, 200619 yr 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//
September 1, 200619 yr 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.
September 1, 200619 yr 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
Create an account or sign in to comment