May 5, 200421 yr Calculation questions should go in the Define Fields forum, but here are two possible solutions: Month(DateTo) - Month(DateFrom) or Truncate((DateTo - DateFrom / 30, 0) Depends on how you define "number of months between".
May 5, 200421 yr Ender said: Month(DateTo) - Month(DateFrom) Oops, This does not work if dates are from different years.
May 5, 200421 yr Hi Ender, I like your calculations, but I had to modify this one, Ender said: Truncate((DateTo - DateFrom / 30, 0) to this to get it to work: Truncate((Next Payment Due - Payment Date) / 30, 0) ???
May 5, 200421 yr ((Year (DateTo) - Year (DateFrom)) * 12 ) + Month (DateTo) - Month (DateFrom) I'm reluctant to use any date calculations that assume a month is 30 days or a year is 365; it's hard-coding errors and inaccuracies into the system. FMP has date functions that can work all this stuff out correctly, automatically taking into account leap years and other vagaries of the calendar.
May 5, 200421 yr My thought on that was getting an answer to this: DateFrom: 2/15/2004 DateTo: 4/1/2004 One might say only "1 month" had passed during that period, because we tend to truncate when we talk about duration (I say I'm 30 years old, not 30.5) But of course you are correct to take into account different length months. If the dates are: DateFrom: 2/15/2004 DateTo: 3/15/2004 The result should be "1 month". My calc did not take this into account.
May 6, 200421 yr Oops, I have a typo in my calculation in the script Lee Smith said: Script Set Field [
Create an account or sign in to comment