the ECHO displays this -SET &LAST_SATURDAY = DATEADD(20120703, 'D', - 3);
LAST_SATURDAY ends up being 20120700
Shouldn't it end up being 20120630? Do I need to use a different Date Format?This message has been edited. Last edited by: Jay Potter,
WebFocus 8.1.5 iSeries/Windows DB2/SQL/Access Dev Studio App Studio Maintain ReportCaster
July 03, 2012, 10:43 AM
Mighty Max
DATEADD uses smart dates. As a workaround you can use DATECVT to convert the date to a smart date. Then use DATEADD to subtract the days. Then uses DATECVT again to change the smart date into a numeric date.
DATEADD has issues with Dialog Manager. Can you do this in a define instead.
In Focus since 1993. WebFOCUS 7.7.03 Win 2003
July 03, 2012, 10:49 AM
Prarie
OR you can do that.
July 03, 2012, 11:25 AM
Jay Potter
Thanks! The DATECVT worked. It's great when they document where you can use some in some places but not others.
WebFocus 8.1.5 iSeries/Windows DB2/SQL/Access Dev Studio App Studio Maintain ReportCaster
July 03, 2012, 11:39 AM
Prarie
You should get the book 1001 Ways to Work with Dates in WebFocus. It's documented there that it does not work with Dialog Manager. It's a great thing to have.
July 03, 2012, 11:45 AM
Jay Potter
Thanks! I will look into it.
WebFocus 8.1.5 iSeries/Windows DB2/SQL/Access Dev Studio App Studio Maintain ReportCaster
July 03, 2012, 05:36 PM
Francis Mariani
Prarie, I hope that book documents that you can use Date-Time functions in Dialog Manager when used in conjunction with DATECVT, e.g.
I just had this issue today and in 5 minutes I found the correct code to resolve it. The information here just saved my bacon (again) and made it look like I know what I'm doing.
It would be a whole lot easier to create DEFINE FUNCTIONs for DATEADD, DATEMOV and DATEDIF. If done properly, anything you can do in a TABLE request with these function can be done in Dialogue Manager using the same syntax.
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.