The inner DATECVT converts a string to a date. Then the DATEADD/DATEMOVE function is applied. Then the outer DATECVT converts the resulting date back to a string.
This message has been edited. Last edited by: Francis Mariani,
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
January 17, 2017, 04:43 PM
jcannavo
Francis beat me to it. That inner DATECVT is what you are missing.
JC WebFOCUS Dev Studio / App Studio 8.2.01 Windows 7
@Francis - Loved the way you highlighted the three functions; to help show that/how they are interrelated.
January 17, 2017, 10:51 PM
Francis Mariani
Thanks David. Not something you can find in the functions manual.
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
January 18, 2017, 01:07 AM
Danny-SRL
As I suggested in another post Let's Date : all this converting should be much simplified!
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
January 18, 2017, 10:42 AM
Francis Mariani
It appears IBI is making an attempt at simplifying date functions:
In the documentation WebFOCUS Release 8.1 Version 05M > Reporting Language > Using Functions > Simplified Date and Date-Time Functions, it is explained:
quote:
Simplified date and date-time functions have streamlined parameter lists, similar to those used by SQL functions. In some cases, these simplified functions provide slightly different functionality than previous versions of similar functions. The simplified functions do not have an output argument. Each function returns a value that has a specific data type. When used in a request against a relational data source, these functions are optimized (passed to the RDBMS for processing). Standard date and date-time formats refer to YYMD and HYYMD syntax (dates that are not stored in alphanumeric or numeric fields). Dates not in these formats must be converted before they can be used in the simplified functions. Literal date-time values can be used with the DT function. All arguments can be either literals, field names, or amper variables. Note: The simplified date and date-time functions are not supported in WebFOCUS Maintain.
From this description, it appears strings can be used in the functions. We're on ancient v8.0.08 so I haven't tested the benefits of these newish "simplified" functions.
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