I get error- (FOC36355) INVALID TYPE OF ARGUMENT #2 FOR USER FUNCTION DATEDIF
Please help.
Thanks!This message has been edited. Last edited by: Kerry,
Thanks and Regards, Piscian
WebFocus 714 Windows Server 2003 Enterprise Edition HTML,Excel,PDF
September 12, 2009, 09:23 PM
jimster06
My copy of (Almost ) 1001 Ways to Work with DATES in WebFOCUS contains the following passage about DATEDIF ..."It does not curently work with Dialogue Manager variables." p 289. And I highly recommend the book. Here is a definitive discussion. edit to add URLThis message has been edited. Last edited by: jimster06,
jimster06 DevStu WF 7.6.11 W7 HTML, PDF, EXL2K
September 13, 2009, 04:53 PM
j.gross
You can use DATEDIF in dialog manager -SET, with amper vars as the date arguments, provided you apply .QUOTEDSTRING to them:
Interesting Jack. I'll have to try that one. Another way to get this to work is to use the DATECVT function first (like DATECVT(&YYMD,'I8YYMD','YYMD') and then use DATEDIF on those converted dates. Works for DATEADD as well which also "cannot be used with Dialogue Manager."
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
September 14, 2009, 11:31 AM
Francis Mariani
I've always used the DATECVT method, but this is so much more elegant:
works as well. Why didn't I think of that? No need for the DATECVT function in DM any more.
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
September 14, 2009, 05:59 PM
j.gross
FM --
Not so fast. (Try those with +61 instead of -7 )
The input is required to represent a "smart" date (accepted in either offset integer form or formatted date form), and the output is an offset integer. &YYMD, even with the quotes, is interpreted as an offset of +yy,yym,mdd.
Bottom line -- use a formatted value (&DATEYYMD rather than &YYMD), and apply DATECVT to the result to obtains a displayable date.
- Jack Gross WF through 8.1.05
September 29, 2009, 09:59 AM
Francis Mariani
Yikes! Just found this update after seeing Tony's posting about DATEMOV, I'll be sticking with the DATECVT option, thank you.
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