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     DATEADD bug/feature FWIW

Read-Only Read-Only Topic
Go
Search
Notify
Tools
DATEADD bug/feature FWIW
 Login/Join
 
Master
posted
I just found out that when using DATEADD with business days, if the date being added to is not a business day, DATEADD adjusts it to the next business day, then does the addition. Keep in mind that if you use a holiday file, holidays are not business days.

For example, if I add 2 business days to Jan 1st, 2008 (which is in my holiday file) you get Jan 4th, not Jan 3rd. This is because DATEADD adjusts Jan 1st to Jan 2nd then adds 2 business days.

Likewise, if I add 2 business days to Nov 1, 2008 (which is a Saturday), I get Nov 5th, not Nov 4th. This is because DATEADD adjusts Nov 1 to Nov 3rd then adds 2 business days.

I opened a problem report with IBI and found out this is an undocumented feature of the DATEADD function, not a bug.

I was wondering, for those of you with the manual about using dates (I don't remember the title but it was something like "1000-and-1 ways to use Dates" or "Everything you wanted to know about dates and but was afraid to ask"), is this feature documented there?


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, 2006Report This Post
Virtuoso
posted Hide Post
On page 123 of Almost 1001 Ways to work with Dates...it says the BD Letters instructs the DATEADD function to adjust the date by business-days which are Monday thru Friday.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Master
posted Hide Post
But does it say anything about adjusting the input/source date, the date that is being adjusted, to the next business day? The reason I ask is that is appears to do this only when adding days. Consider the following:
-SET &RUNDT1=DATECVT(DATEADD(DATECVT(20080101,'I8YYMD','YYMD'),'BD',-2),'YYMD','I8YYMD');
-SET &RUNDT2=DATECVT(DATEADD(DATECVT(20080101,'I8YYMD','YYMD'),'BD',2),'YYMD','I8YYMD');
-TYPE &RUNDT1  &RUNDT2 

Gives 20071228 for &RUNDT1 and 20080104 for &RUNDT2.

Since Jan 1 2008 is a holiday and not a business day, it seems to me, that to be consistent, when I substract 2 business days, the source date (20080101) should be adjusted to 20071231, then substract the 2 days to give 20071227 not 20071228.


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, 2006Report This Post
Virtuoso
posted Hide Post
Not specifically that I've seen...this is a 340 page book full of examples and tips...it's kinda hard to find all notations....Perhaps someone out there has read the entire book. Wink


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 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     DATEADD bug/feature FWIW

Copyright © 1996-2020 Information Builders