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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at firstname.lastname@example.org and provide your corporate email address, company, and name.
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,
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