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.
ok, this definitely has to fall into the "WTF" category...
I'm trying to subtract 7 days from today in my code (creating a defined field). After trying everything I could think of, I found the following function:
DATEADD(YYMDdate, 'unit', #units)
so I did
PROCDATE/YYMD=DATEADD(&YYMD, 'D', -7)
Why am I getting 4/98/04 for a result? I thought WebFocus used Smart Dates? It works if I ADD 7 days, but I want to SUBTRACT!
ARGHHHH!!!!
Jen
Posts: 68 | Location: Springfield MA | Registered: May 07, 2003
Date subroutines are generally used for old date formats (A8MDYY). With new dates (MDYY) you should just be able to add and subtract days. have you tried this?
DEFINE FILE xxxx CURDATE/YYMD=&YYMD; NEWDATE/YYMD=DATEADD(CURDATE,'D',-7); END
or
DEFINE FILE xxxx DT2/YYMD=DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D',-7); END
The reason for this is that dialog manager doesn't understand smart dates, it only works with alphanumeric fields. &YYMD returns the alphanumeric value 20040505 which needs to be converted to a smart date.
That works if I am just printing the field. But what I'm trying to do is then filter on that field LASTWEEK, by using it in a where clause.
For example:
DEFINE FILE TRANSACTIONS TODAY/MDYY WITH CUSIP=&MDYY; LASTWEEK/MDYY=TODAY - 7; END TABLE FILE TRANSACTIONS SUM stuff BY stuff WHERE (TRADE_DATE GE LASTWEEK) END
I'm running against a SQL table. TRADE_DATE is a smart date with format YYMD.
Posts: 68 | Location: Springfield MA | Registered: May 07, 2003