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.
I have a variable in dialog manager that contains date in the format of 'yyyy/mm/dd'. How can I convert it to a date value so that I can apply the DATEADD function to it? I have searched in the forum but I have only found examples that work when the date value is coming from TABLE FILE. I have not been able to find examples that work in dialog manager.This message has been edited. Last edited by: JC Zhu,
If you're just trying to add or subtract days from the initial date value, you can also strip out the slashes with EDIT and use the legacy function AYMD. With AYMD, conversion to a SmartDate value is not necessary.
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
It is important to note that Dialogue Manager interprets dates as alphanumeric or numeric, and the date functions such as DATEADD requires a standard date stored as an offset from the base date. What this means is you have to convert the date string to a date offset using the function DATECVT. Here is a sample:
-* Initial Date string
-SET &MYDATE = '2012/01/01';
-*Removing the '/' from the date
-SET &MYDATE = EDIT(&MYDATE, '9999$99$99');
-*Converting the date to an offset
-SET &MYDATE_OFFSET = DATECVT(&MYDATE, 'I8YYMD', 'YYMD');
-* Now you can use the &MYDATE_OFFSET with most of the date manipulation functions, such as DATEADD and DATEMOV
Thanks for the answers. I have just found that I can more easily achieved that with passing the variable to the DATEADD function directly without any conversion. I tried this initially but it didn't work. I got this to work by adding single quotes around the variable name when passing the value to the DATEADD function. With the single quotes, DATEADD seems to be able to automatically interpret it as a date.