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     [SOLVED] DATEDIF error

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] DATEDIF error
 Login/Join
 
Platinum Member
posted
When I do this:

DEFINE FILE CAR
NUMDAYS/I10 WITH CAR = DATEDIF('20110501','20110531','WD');
END
TABLE FILE CAR
PRINT NUMDAYS
END

I get 21, but I think I should get 22? But when I do this:

DEFINE FILE CAR
NUMDAYS/I10 WITH CAR = DATEDIF('20110401','20110430','WD');
END
TABLE FILE CAR
PRINT NUMDAYS
END

I get 21, which would be correct. Does anyone know why this function works for April, but not May? Thanks!

This message has been edited. Last edited by: Kerry,


Windows version 768
 
Posts: 215 | Registered: March 16, 2006Report This Post
Expert
posted Hide Post
In the U.S., we don't work on Memorial Day...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
<JG>
posted
Bug perhaps?

Holidays should not count as week days only as business days if you have a holiday file
 
Report This Post
Expert
posted Hide Post
Good point John.

7.6.8(even numbered, this is a maintenance release) has 5 Hotfixes:

7.6.8 Hotfix info

But, don't see anything on Date Functions...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
What do you get if you change the WD to D?

I think you get 30 for May

not correct? sure...May has 31 days...but you should not start at the 1ste of May but at the last day of April




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
<JG>
posted
Frank, then why does it work for April.

Actually this is a real bug. Eeker

Pick any month where the 1st starts on a weekend and the answer is -1 day
 
Report This Post
Platinum Member
posted Hide Post
Yeah, after I posted, I wracked my brain trying to figure it out and realized that when you do datediff, normally you have to put +1 on the end of it (if you want the days of the month). So, if I'm just doing work days, and the last day of the month is a weekend, you don't have to do that... it is inherently done for you. So, in looking at datedif each month from Jan to October of 2011, only April and July are correct b/c they are the only two months that end on Saturday or Sunday. IBI really needs to focus on making functions more user-friendly or at least include this in documentation, IMHO.


Windows version 768
 
Posts: 215 | Registered: March 16, 2006Report This Post
Platinum Member
posted Hide Post
quote:
Originally posted by Tom Flynn:
In the U.S., we don't work on Memorial Day...


If you work for a hospital, you do.


Windows version 768
 
Posts: 215 | Registered: March 16, 2006Report 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     [SOLVED] DATEDIF error

Copyright © 1996-2020 Information Builders