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] DATEADD in a -SET command

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] DATEADD in a -SET command
 Login/Join
 
Member
posted
Does anyone know if a DATEADD can be used in a -SET command. I've tried

-SET &Print_Date_YYMD = &YYMD;
-SET &tdate=DATEADD(&Print_Date_YYMD, 'D', 30)

with no success

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


7.6.2 AIX 5.5
Apache
IWAY adapters: DB2 Mainframe and RS/6000, IMS Mainframe, Sequal
Server 2005
XP/Office 2003 Applications
 
Posts: 7 | Location: Omaha, Ne. | Registered: June 29, 2006Report This Post
Virtuoso
posted Hide Post
Work fine. FYI add semicolon at the end

-SET &Print_Date_YYMD = &YYMD;
-SET &tdate=DATEADD(&Print_Date_YYMD, 'D', 30);

-TYPE &Print_Date_YYMD, &tdate


Are you really under 7.6.2 ?


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Virtuoso
posted Hide Post
Per documentation: DATEADD requires a date to be in date format. Since Dialogue Manager interprets a date as alphanumeric or numeric, and DATEADD requires a standard date stored as an offset from the base date, do not use DATEADD with Dialogue Manager unless you first convert the variable used as the input date to an offset from the base date.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Virtuoso
posted Hide Post
You can also use AYMD

-SET &tdate=AYMD(&YYMD, 30, 'YYMD');
-TYPE &tdate


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Member
posted Hide Post
-SET &TDATE=DATECVT(DATEADD(DATECVT(&Print_Date_YYMD,'I8YYMD','YYMD'),'D',30),'YYMD','I8YYMD')

DATEADD works on dates that are in smart date format; however, dialogue manager variables are always alphanumeric format. Therefore, you have to convert your dialogue manager date to a smart date before you perform the DATEADD function, then convert it back to an alphanumeric format after the DATEADD function. Because of this you have to use nested functions as above.

Hope this helps.

This message has been edited. Last edited by: awardb,


Release 8.1.05
Windows
Excel, HTML, PDF, AHTML, COMT
 
Posts: 5 | Registered: July 31, 2013Report This Post
Master
posted Hide Post
You can create a DEFINE FUNCTIONs that does the same thing in Dialogue Manager as the DATE functions DATEADD, DATEMOV and DATEDIFF to Reporting. Do a search on UDATEADD.

This message has been edited. Last edited by: jgelona,


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report 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] DATEADD in a -SET command

Copyright © 1996-2020 Information Builders