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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at email@example.com and provide your corporate email address, company, and name.
If you are doing the date compare against a relational data source, not all of them will pass a date WHERE screen when the table date is being compared to a DEFINE field. Teradata is one example of an RDBMS where you must specify a data literal as the right-hand side of the compare or the WHERE clause does not get passed to Teradata.
Here is a way, Cecilia, to do this with Dialogue Manager
-* Assume &REQUEST_TIME is the date coming from the launch page. -SET &ENDDT=AYMD(&REQUEST_TIME,7,'I8YYMD'); TABLE FILE ... PRINT ... WHERE REQUEST_TIME GE &REQUEST_TIME AND REQUEST_TIME LE &ENDDT;
Now you didn't mention the format of the table column REQUEST_TIME. That might require an alteration of my code above. The fact that you have the word time in the name makes me think it might be a date-time stamp. Let us know if that is the case.
The REQUEST_TIME is a date-time stamp. However, the parameter &REQUEST_TIME is an alpha format. I got an error message when I run your code: (FOC36355) INVALID TYPE OF ARGUMENT #1 FOR USER FUNCTION AYMD
I used DT(&REQUEST_TIME) and still got the same error message...
WebFocus server 768 Developer studio 768 Windows XP Output: Excel, HTML, PDF, AHTML
Posts: 7 | Location: New York | Registered: November 06, 2007
The code above looks crazy, but what's happening is you have to convert the alpha string to a Date format using DATECVT, then use DATEADD to add 7 days, then use DATECVT to convert from Date format back to alpha string - read the line of code form inside going outwards.
This of course, assuming that &REQUEST_TIME is an alpha string that contains 8 characters like '20071231'.
Then your WHERE statement should be:
WHERE REQUEST_TIME FROM DT(&REQUEST_TIME 00:00:00.000) TO DT(&REQUEST_TIME1 23:59:59.999);
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