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     [CLOSED] DATE FUNCTION

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] DATE FUNCTION
 Login/Join
 
Gold member
posted
Hi, I am trying to calculate the begin date and end date to run reports automatically depending on today's date. but my begin date is to start from past week tuesday to this week monday. However I am having problems calculating going to past month automatically from this month if day is 00.
for example, say today's date is May 7,2013.

-SET &TODAY= '20130507';
-SET &WKDAY=DOWK(&TODAY,'A3');
-TYPE &TODAY IS &WKDAY DAY

-SET &BOW = DATECVT((DATEMOV((DATECVT(&TODAY,'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD');
-TYPE &BOW IS BEGINNING DAY OF THIS WEEK.

-****CALCULATE END DATE FIRST SINCE EASIER, ENDING ON THIS RECENT MONDAY
-SET &END_DATE = EDIT (&BOW,'$$$$99') || '/' || EDIT (&BOW,'$$$$$$99') || '/' || EDIT (&BOW,'9999');

-TYPE &BOW IS END DATE &END_DATE.
-***
-* NOW CALCULATES BEGIN DATE SINCE IT IS TO BE PAST TUESDAY

-SET &TEST = DATEADD(&BOW, 'WD', -6);

-TYPE &TEST IS THE BEGIN DATE AND &END_DATE IS END DATE.

-EXIT


how do I get to the April 30,2013?
'D' or 'BD' or 'WD' not working...

This message has been edited. Last edited by: <Kathryn Henning>,


on VMS: OpenVMS AXP V8.2 Prod and TestEnvironment
Webfocus: WebFocus 7.6.1 Prod and TestEnvironment
 
Posts: 71 | Registered: May 23, 2004Report This Post
Virtuoso
posted Hide Post
You need to DATECVT before DATEADD:
-SET &TODAY= '20130507';
-SET &WKDAY=DOWK(&TODAY,'A3');
-TYPE &TODAY IS &WKDAY DAY

-SET &BOW = DATECVT((DATEMOV((DATECVT(&TODAY,'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD');
-TYPE &BOW IS BEGINNING DAY OF THIS WEEK.

-****CALCULATE END DATE FIRST SINCE EASIER, ENDING ON THIS RECENT MONDAY
-SET &END_DATE = EDIT (&BOW,'$$$$99') || '/' || EDIT (&BOW,'$$$$$$99') || '/' || EDIT (&BOW,'9999');

-TYPE &BOW IS END DATE &END_DATE.
-***
-* NOW CALCULATES BEGIN DATE SINCE IT IS TO BE PAST TUESDAY

-SET &START = DATECVT((DATEADD((DATECVT(&BOW,'I8YYMD','YYMD')),'WD',-6)),'YYMD','I8YYMD');
-SET &START_DATE = EDIT (&START,'$$$$99') || '/' || EDIT (&START,'$$$$$$99') || '/' || EDIT (&START,'9999');

-TYPE &START_DATE IS THE BEGIN DATE AND &END_DATE IS END DATE.

-EXIT


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report 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     [CLOSED] DATE FUNCTION

Copyright © 1996-2020 Information Builders