× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



In a message dated 6/1/2001 6:57:12 PM Eastern Daylight Time,
Tyra_Brodsky@vfc.com writes:


I am trying to write a procedure that will bring back the number of months
between 2 dates.  The problem is that SUBDUR doesn't give me the number I
want.  For example, the number of months between any day in June 2001 and
any day in July 2001 is 1 month, June 2001 and August 2001 is 2 months,
etc.  Does anyone have a solution.  We are on V4R4.


Can't you just do:

    startdate       adddur     1:*M         nextmonth

That will jump you ahead 1 month - then you may test if your 'startdate' is
LT GT EQ your 'enddate' by comparing it to the 'nextmonth' date.

Keep a counter rolling and once it hits the date you have as your 'enddate'
you can stop counting.

You were kind of vague on the problem you were having and why the SUBDUR
wouldn't work for you, it should.

A little backwards programming but maybe it will work for ya!

Bill


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.