Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     DATEDIF, Elapsed Months - Fraction of a month?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
DATEDIF, Elapsed Months - Fraction of a month?
 Login/Join
 
Guru
posted
FOCUS warriors:

Is there some way to alter this compute so that we can get a fraction of a month:

COMPUTE ELAPSED_MONTH_COUNT/P7.1C = DATEDIF(COMMISSION_DT,MID_MONTH_DT, 'M');

1.) Both of the dates are Smart Dates.
2.) The Mid-Month Date is based on the &YYM | '15'

We need to differentiate at a breaking point of 5.5 months. All of my examples have been like 4.0 months, 5.0 months, etc.

I scoped the entire site and also checked IBI TechResponse so anything you provide will be greatly appreciated.

Thanks for your help.

Happy Trails,
Sandy
 
Posts: 238 | Location: Atlanta, GA/Rehovot, Israel | Registered: May 06, 2003Report This Post
Guru
posted Hide Post
DATEDIF returns a whole number not fractions.

I take it the dates you are dealing with could be any day of any month? Not just beginning or end of month.


ttfn, kp


Access to most releases from R52x, on multiple platforms.
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report This Post
Guru
posted Hide Post
The mid-month date is always XXXX-XX-15. The Commission Date could be anytime in the month.


Sandy Kadish
Dev: 8.2.04- PostgreSQL
Test: 8.2.04 - PostgreSQL
Prod: 8.2.04 - PostgreSQL
 
Posts: 238 | Location: Atlanta, GA/Rehovot, Israel | Registered: May 06, 2003Report This Post
Platinum Member
posted Hide Post
Sandy,

Why not get the difference in number of days, then divide by approx 30.4 to get the number of months (with decimal places). Here's an example using the MOVIES file:

DEFINE FILE MOVIES

-* Compare to today's date
TDATE/YYMD = &YYMD;

-* Get days elapsed since release date
DAYSELAP/D5 = DATEDIF(RELDATE, TDATE, 'D');

-* Convert to months elapsed since release date
MONTHSELAP/D8.2 = DAYSELAP / 30.4

END

TABLE FILE MOVIES
PRINT
MOVIECODE
RELDATE
-* TDATE
DAYSELAP
MONTHSELAP
END

Regards,
Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
 
Posts: 210 | Location: Ottawa | Registered: November 03, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     DATEDIF, Elapsed Months - Fraction of a month?

Copyright © 1996-2020 Information Builders