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] Help with DM Date logic

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Help with DM Date logic
 Login/Join
 
Member
posted
Hi all,
Trying to figure out why my DM code to determine the First and Last days of the prior month isn't working.
Here's my code:
-TYPE TODAY IS &YYMD
-SET &LSTBOM = DATECVT(DATEMOV(DATECVT((DATEADD(&YYMD, 'M', -1)), 'I8YYMD', 'YYMD'), 'BOM'),'YYMD', 'I8YYMD');
-SET &LSTEOM = DATECVT(DATEMOV(DATECVT((DATEADD(&YYMD, 'M', -1)), 'I8YYMD', 'YYMD'), 'EOM'),'YYMD', 'I8YYMD');

-TYPE Beginning of Month: &LSTBOM
-TYPE End of Month: &LSTEOM

Thanks in advance.
Doug

This message has been edited. Last edited by: FP Mod Chuck,


I support multiple Information Builders customers across platforms with very varied configurations.
 
Posts: 10 | Registered: December 18, 2007Report This Post
Expert
posted Hide Post
Hi Doug,

Almost there, but you need to convert the &YYMD first into YYMD -

-SET &LSTBOM = DATECVT(DATEMOV(DATEADD(DATECVT(&YYMD, 'I8YYMD', 'YYMD'), 'M', -1), 'BOM'),'YYMD', 'I8YYMD');
-SET &LSTEOM = DATECVT(DATEMOV(DATEADD(DATECVT(&YYMD, 'I8YYMD', 'YYMD'), 'M', -1), 'EOM'),'YYMD', 'I8YYMD');

-TYPE TODAY IS &YYMD
-TYPE New dates are &LSTBOM and &LSTEOM


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
I pulled these lines directly from Tech Support and things are working
-TYPE TECH SUPPORT
-SET &CURRDATE = DATECVT(&YYMD,'I8YYMD','YYMD');
-SET &BEGCURMO = DATEMOV(&CURRDATE,'BOM');
-SET &ENDCURMO = DATEMOV(&CURRDATE,'EOM');
-SET &BEGPRIORMO=DATEADD(&BEGCURMO,'M',-1);
-SET &ENDPRIORMO=DATEMOV(&BEGPRIORMO, 'EOM');
-SET &BEG_C_MO = DATECVT(&BEGCURMO,'YYMD','I8YYMD');
-SET &END_C_MO = DATECVT(&ENDCURMO,'YYMD','I8YYMD');
-SET &BEG_P_MO = DATECVT(&BEGPRIORMO,'YYMD','I8YYMD');
-SET &END_P_MO = DATECVT(&ENDPRIORMO,'YYMD','I8YYMD');
-TYPE CURRENT DATE IS &DATEYYMD
-TYPE CURRENT MONTH - BEGINNING &BEG_C_MO
-TYPE ENDING &END_C_MO
-TYPE PRIOR MONTH - BEGINNING &BEG_P_MO
-TYPE ENDING &END_P_MO


Sandy Kadish
Dev: 8.2.04- PostgreSQL
Test: 8.2.04 - PostgreSQL
Prod: 8.2.04 - PostgreSQL
 
Posts: 238 | Location: Atlanta, GA/Rehovot, Israel | Registered: May 06, 2003Report This Post
Member
posted Hide Post
Thank you both! Working perfectly!


I support multiple Information Builders customers across platforms with very varied configurations.
 
Posts: 10 | Registered: December 18, 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     [SOLVED] Help with DM Date logic

Copyright © 1996-2020 Information Builders