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.
I am trying to get the equivalent of the Excel function YEARFRAC in WebFOCUS. YEARFRAC expresses the difference between two dates as a year fraction. I was trying to write code using HDIFF that I could use to math out the equivalent, but it isn't working for me.
So for example if I've got a start date of 08/26/2010 and an end date of 05/19/2012 and I use HDIFF to get the year difference
YEARS_BETWEEN will return a value of 2.0 (I'm guessing it is rounding up from 1.73 which is what YEARFRAC returns). How do I get it to express the value without rounding?This message has been edited. Last edited by: rray9895,
DEFINE FILE CAR ENDDATE/YYMD = '20120519'; STARTDATE/YYMD = '20100826'; YEARS_BETWEEN/D12.2 = DTDIFF(ENDDATE,STARTDATE,YEAR); END TABLE FILE CAR PRINT YEARS_BETWEEN BY COUNTRY END
And it gave back 2.00 as well, I think it doesn't look at the full date just the YEAR portion provided when doing the calculation
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005
Will that return the correct value for you on 31st of December of a leap year? That would be ~1.0027, which is >1.
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
I've had a NFR sitting out there since 2011 asking IBI to address this issue. In my problem report that became the NFR, IBI said that DATEDIF truncates while HDIFF rounds. The NFR status says it is in "Programming" whatever that means. Hard to believe it would be in programming over 8 years. When I'm using date time fields I generally use Minutes as the unit. Then if I need fractional days, I divide by 1440 minutes per day. If I need fractional years, I divide by 525600 minutes per year or 527040 minutes per year the from and to dates cross a leap day.This message has been edited. Last edited by: jgelona,
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006