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] How to get previous month end date

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] How to get previous month end date
 Login/Join
 
Member
posted
Hi,

Could any one help me out to find previous month end date. I have already checked previous discussion in forum on subject but could not figured out my error.

Here is my code


-SET &DT_CURR = &YYMD;
-SET &DT_EOM = DATECVT(( DATEMOV((DATECVT(&DT_CURR,'I8YYMD','YYMD')),'EOM')),'YYMD','I8YYMD');

-TYPE &DT_CURR
-TYPE &DT_EOM

-SET &END_PRIOR_MO = DATEADD(&DT_EOM,'M',-1);
-TYPE &END_PRIOR_MO

Here are the results:

20150223
20150228

570700513 'this should show 20150131'

Anyone help on it will be highly appreciated

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


WebFocus App Studio
Windows 10
 
Posts: 4 | Registered: August 30, 2013Report This Post
Expert
posted Hide Post
Just a suggestion - calculate the BOM, take one day from it (whilst it's still in YYMD format - count of days) and then convert it to I8YYMD.

-SET &DT_CURR = &YYMD;
-SET &DT_EOM = DATECVT(DATEMOV(DATECVT(&DT_CURR,'I8YYMD','YYMD'),'EOM'),'YYMD','I8YYMD');

-TYPE &DT_CURR
-TYPE &DT_EOM

-SET &END_PRIOR_MO = DATECVT(DATEMOV(DATECVT(&DT_CURR,'I8YYMD','YYMD'),'BOM')-1,'YYMD','I8YYMD');
-TYPE &END_PRIOR_MO

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
Member
posted Hide Post
Excellent! Thanks Tony it works for me.

Much appreciated!

Fayyaz


WebFocus App Studio
Windows 10
 
Posts: 4 | Registered: August 30, 2013Report This Post
Expert
posted Hide Post
You are most welcome, and welcome to the Forum!

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
Gold member
posted Hide Post
quote:
-SET &DT_CURR = &YYMD;
-SET &DT_EOM = DATECVT(DATEMOV(DATECVT(&DT_CURR,'I8YYMD','YYMD'),'EOM'),'YYMD','I8YYMD');

-TYPE &DT_CURR
-TYPE &DT_EOM

-SET &END_PRIOR_MO = DATECVT(DATEMOV(DATECVT(&DT_CURR,'I8YYMD','YYMD'),'BOM')-1,'YYMD','I8YYMD');
-TYPE &END_PRIOR_MO


Can someone help me to get last day of last quarter? Thank you!


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 56 | Registered: January 13, 2015Report This Post
Expert
posted Hide Post
Have you tried reading the documentation regarding the DATEMOV function? Have you tried the "EOQ" (end of quarter) move-point?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Guru
posted Hide Post
Good One


WebFOCUS 8.1.05 / APP Studio
 
Posts: 272 | Location: Brazil | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
Hi..
I just posted it without a thought as I was wrapping my day and my mind wasn't working. Later I used datmov to get BOQ and did -1.
Thank you !!
 
Posts: 56 | Registered: January 13, 2015Report 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] How to get previous month end date

Copyright © 1996-2020 Information Builders