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     Get last month's MTD range

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Get last month's MTD range
 Login/Join
 
<kvn>
posted
Easy problem that has me stumped. How do I get last month's date? I need to show the MTD range of the previous month.

I need to store the date into a SET Variable.

I've tried DATEADD and AYM and I just can't get those functions to work in the SET using &DATEYYMD or &YYMD. They work if I use them in a DEFINE but not in SET.
 
Report This Post
Platinum Member
posted Hide Post
Try this.

-SET &TODAY = &YYMD/100;
-SET &LAST_MONTH = AYM(&TODAY, -1, YYM);
-TYPE &TODAY
-TYPE &LAST_MONTH
-EXIT
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Report This Post
Platinum Member
posted Hide Post
-* get last month
-SET &TODAY = &YYMD/100;
-SET &LAST_MONTH = AYM(&TODAY, -1, YYM);
-SET &THIS_MONTH = AYM(&TODAY, 0, YYM);
-********************************************
-* get last month date range
-SET &SDATE = &LAST_MONTH||'01';
-SET &FIRSTDAY = &THIS_MONTH||'01';
-SET &EDATE = AYMD(&FIRSTDAY, -1, YYMD);
-TYPE TODAY = &TODAY
-TYPE LAST_MONTH = &LAST_MONTH
-TYPE THIS MONTH = &THIS_MONTH
-TYPE FIRSTDAY = &FIRSTDAY
-TYPE START RANGE = &SDATE
-TYPE END_RANGE = &EDATE
-EXIT
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Report This Post
<Pietro De Santis>
posted
Use the DATEMOV function, it normally works only with Date fields, but here's how you can use the it in Dialog Manager:

-SET &DT1_YYMD = '&YYMD';

-* Determine Beginning of Week for selected date
-SET &WTDF =
- DATECVT(( DATEMOV((DATECVT(&DT1_YYMD,'I8YYMD','YYMD')),'BOW')),
- 'YYMD','I8YYMD');

The inside DATECVT function converts &DT1_YYMD from I8YYMD to YYMD to enable use of the DATEMOV function. The outside DATECVT function converts the result from YYMD back to I8YYMD.

Neat, innit?
 
Report This Post
<kvn>
posted
Thanks both. Each solution worked well.
 
Report 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     Get last month's MTD range

Copyright © 1996-2020 Information Builders