Don,

Date2 will always be later than date1 so the Abs won't be necessary.

Ralph,

Your idea is certainly simpler; I may need to add a "2" to cope with single month differences around February but I will investigate it further.

Thanks both.

Michael


Ralph Alvy wrote:
On Saturday 09 September 2006 05:53, Michael Iannantuoni wrote:
  
I have two date fields formatted as DMYD99/9999 and want to find the
difference between them in Calendar Months.

I've come up with the following, separated out for clarity into three
part by brackets:

IF YEAR[date2] = YEAR[date1] THEN MONTH[date2] - MONTH[date1] ELSE  (12
- MONTH[date1]) + ((YEAR[date2] - YEAR[date1] -1) * 12) + (MONTH[date2])
ENDIF
    

How accurate does this need to be? What if you just computed the number of 
30-day periods between the two dates? Like this:

(RecentDate - EarlierDate)/30
_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/mailman/listinfo/dataperf

  
_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/mailman/listinfo/dataperf

Reply via email to