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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
simple date add
 Login/Join
 
Platinum Member
posted
This should be the easiest thing in the world. I'm trying to use dialog manager to set tomorrow's date:
-SET &MEASDATE = &DATE;
-SET &NEXTDATE = DATEADD(&MEASDATE,'D',1);

Result:
INVALID TYPE OF ARGUMENT #1 FOR USER FUNCTION DATEADD

Anyone?
(I HATE WF date handling)


Thanks.

Mark
WF 7.6 Windows
 
Posts: 150 | Registered: July 26, 2007Report This Post
Expert
posted Hide Post
Unfortunately, you have to convert the "alpha" Dialogue Manager date to a date field before using DATEADD.

E.G.:
-*-- Determine Period End Date 24 months prior to selected Period ---
-SET &DT24 =
- DATECVT( DATEADD(DATECVT(&F1V1,'I8YYMD','YYMD'),'M', -24),'YYMD','I8YYMD');


The inner DATECVT converts the DM variable to a date field, then DATEADD is applied, then the outer DATECVT converts the DATEADD result back to an alpha DM variable.

Your code:
-SET &MEASDATE = &YYMD;
-SET &NEXTDT1 = 
- DATECVT( DATEADD(DATECVT(&MEASDATE,'I8YYMD','YYMD'),'D', 1),'YYMD','I8YYMD');

-SET &NEXTDT2 = CHGDAT('YYMD','MDY',&NEXTDT1,'A8'); 

-SET &NEXTDATE = EDIT(&NEXTDT2,'99/99/99');                           

-TYPE &MEASDATE - &NEXTDATE

I ALWAYS use YYMD formatted dates in calculations. You can always change the format for printing purposes


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
Platinum Member
posted Hide Post
ok, that's helpful. to add one more question though:

my initial date (&MEASDATE) is sometimes passed into the fex as mm/dd/yy string. How would I accomplish the same thing if I start with "9/24/07" for example?


Thanks.

Mark
WF 7.6 Windows
 
Posts: 150 | Registered: July 26, 2007Report This Post
Expert
posted Hide Post
Sorry 'bout that.

-SET &MEASDATE = &DATE;

-*-- Strip the slash separator character
-SET &MEASDT1 = EDIT(&MEASDATE,'99$99$99');

-*-- Convert the variable to a Date, add a day, convert back to integer
-SET &NEXTDT1 = 
- DATECVT( DATEADD(DATECVT(&MEASDT1,'I6MDY','YYMD'),'D', 1),'YYMD','I8YYMD');

-*-- convert from yymd to mdyy
-SET &NEXTDT2 = CHGDAT('YYMD','MDY',&NEXTDT1,'A8'); 

-*-- add date separator character
-SET &NEXTDATE = EDIT(&NEXTDT2,'99/99/99');                           

-TYPE &MEASDATE - &NEXTDATE


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
Platinum Member
posted Hide Post
ah yes... i was close...i wasn't using the '$' in EDIT. Thanks Francis.


Thanks.

Mark
WF 7.6 Windows
 
Posts: 150 | Registered: July 26, 2007Report This Post
Expert
posted Hide Post
for DM dates, i use the AYMD and the AYM functions
-SET &TODAY = &YYMD ;
-SET &TOMORROW = AYMD( &TODAY, 1, 'I8YYMD');

We on the Point love FOCUS date functions, wttw.
there's an entire book on the subject, which you can order from the Tech Support site.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
-SET &DT1 = &YYMD ;
-SET &DT2 = AYMD(&YYMD ,1, 'I8' );
-TYPE TODAY: &YYMD TOMORROW: &DT2
-EXIT


note: you may need need to set DATEFNS
to put slashes or dashes you will need to add a few statements
Ira
 
Posts: 29 | Registered: March 30, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders