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] to convert back to MDYY format

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] to convert back to MDYY format
 Login/Join
 
Gold member
posted
I have this working to calculate to get beginning of the week as End date fr my query to end depending on today's date and
last tuesday as Begining date.

-SET &WKDAY=DOWK(&YYMD,'A3');

-SET &BGN_DATE = DATECVT((DATEMOV((DATECVT(&YYMD,'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD') - 6;
-SET &END_DATE = DATECVT((DATEMOV((DATECVT(&YYMD,'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD');

NOW those 2 dates are in YYMD format. How do convert back to MDYY format? I kept getting 0 for the HDATE ..or should I use DATECVT? I kept getting errors using either one. Any help on this is much appreciated!

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
Silver Member
posted Hide Post
-SET &DISPLAYDATE = EDIT(DATECVT(DATEADD(DATECVT(&BGN_DATE,'I8YYMD','YYMD'),'D',0),'YYMD','I8MDYY'),'99/99/9999');


Prod/Dev: WebFOCUS 8.0.06 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.06 on Windows 7
 
Posts: 31 | Registered: April 22, 2013Report This Post
Gold member
posted Hide Post
got it! many thanks!


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
quote:
-SET &BGN_DATE = DATECVT((DATEMOV((DATECVT(&YYMD,'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD') - 6;

You are going to hit a problems when you run over the end of the month, as this will fail. Try:
SET TESTDATE = 20130507
-RUN
-SET &BGN_DATE = DATECVT((DATEMOV((DATECVT(&YYMD,'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD') - 6;
-SET &DISPLAYDATE = EDIT(DATECVT(DATEADD(DATECVT(&BGN_DATE,'I8YYMD','YYMD'),'D',0),'YYMD','I8MDYY'),'99/99/9999');
-TYPE &DISPLAYDATE 


You will have to use DATEADD to move back 6 days. I much prefer to ignore the DATECVT and &YYMD type approaches and use functions throughout when in Dialogue Manager:
-SET &MDYY_END      = HCNVRT(HDTTM(DATEMOV(HDATE(HGETC(8,'HYYMDs'),'YYMD'),'BOW'),8,'HMDYYS'),'(HMDYY)',10,'A10') ;
-SET &MDYY_BGN      = HCNVRT(HDTTM(DATEADD(DATEMOV(HDATE(HGETC(8,'HYYMDs'),'YYMD'),'BOW'),'D',-6),8,'HMDYYS'),'(HMDYY)',10,'A10') ;
-TYPE &MDYY_END
-TYPE &MDYY_BGN


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     [SOLVED] to convert back to MDYY format

Copyright © 1996-2020 Information Builders