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 function [SOLVED]

Read-Only Read-Only Topic
Go
Search
Notify
Tools
DATEDIF function [SOLVED]
 Login/Join
 
Platinum Member
posted
Can someone explain to me why the result of this code is 0? Thanks!

SET BUSDAYS = _MTWTF_
-RUN
-SET &BDAY= DATEDIF(20081201,20081231,'BD');
-TYPE &BDAY

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


Windows version 768
 
Posts: 215 | Registered: March 16, 2006Report This Post
Expert
posted Hide Post
... because the requirement for that function is full component dates and not numeric equivalents.

Try -

-SET &BDAY= DATEDIF('2008/12/01','2008/12/31','BD');

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Guru
posted Hide Post
quote:
SET BUSDAYS = _MTWTF_
-RUN
-SET &BDAY= DATEDIF(20081201,20081231,'BD');
-TYPE &BDAY


I get 22 when I run your code.


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Virtuoso
posted Hide Post
DATEDIF seems to accept smart dates, or anything it would allow you to assign to a /YYMD smart date.

Observation suggests the assignment of integer constants to smart-date variables (and the interpretation of DATEDIF's date arguments) makes allowance for "reasonable-looking" yyyymmdd integer values as if they were presented in a /I8YYMD variable; and any other integer value as a date-offset (as if presented in a /YYMD variable).

SET BUSDAYS = _MTWTF_
-RUN
-SET &BDAY1= DATEDIF(20081201,20081231,'BD');
-SET &BDAY2= DATEDIF(0+20081201,0+20081231,'BD');
-SET &BDAY3= DATEDIF('20081201','20081231','BD');
-SET &BDAY4= DATEDIF('2008/12/01','2008/12/31','BD');
-SET &BDAY5A=DATECVT(20081201, 'I8YYMD', 'YYMD');
-SET &BDAY5B=DATECVT(20081231, 'I8YYMD', 'YYMD');
-SET &BDAY5C=DATEDIF(+&BDAY5A,+&BDAY5B,'BD');
-SET &BDAY6= DATEDIF('DEC 01, 2008','DEC 31, 2008','BD');
-? &BDAY 


CURRENTLY DEFINED & VARIABLES STARTING WITH 'BDAY':
 &BDAY1        = 22
 &BDAY2        = 22
 &BDAY3        = 22
 &BDAY4        = 22
 &BDAY5A       = 39417
 &BDAY5B       = 39447
 &BDAY5C       = 22
 &BDAY6        = 22


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 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 function [SOLVED]

Copyright © 1996-2020 Information Builders