This is a complimentary tip available only to SPSS Direct subscribers.
In ShowCase Query, is it possible to create a variable that conditions against the current date, without having to change the current date every time the query is run?
ShowCase Query enables you to set up conditions to go against the current date, so you don't have to change the date with each query execution. This capability is helpful when producing, for example, daily sales totals, or reports on the number of employees during a particular time period.
To do this, you create a condition using the CURDATE() function, rather than creating a variable to be updated each time. The CURDATE() function uses the current date for a comparison. In the Condition dialog box, click on the Expression button to use the standard functions provided by ShowCase. The condition will be similar to the one shown in Figure 1 below:

Figure 1: A condition in the Condition dialog box.
Click image to enlarge.
ShowCase Query automatically adjusts the value of the condition each day. To view information from the previous day (as in the case of daily sales totals), the condition will look similar to the one shown in Figure 2 below:

Figure 2: A condition for viewing information from the previous day.
Click image to enlarge.
You can create conditions with CURDATE() using, for example, the equal (=), greater than (>), or less than (<) signs. You can also perform these calculations in terms of days, months, and years. Below are additional examples of using the CURDATE() function to create conditions:
Date(HIREDT, YYMMDD) < CURDATE
Date(LVDATE, YYMMDD) > CURDATE - 6 months
Please note that this function is available when processing with the ShowCase ODBC driver against IBM® eServer™ iSeries™ (AS/400®) databases only. Other ODBC drivers have more limited sets of functions.
For more information on conditions and the CURDATE() function, refer to the ShowCase online help (search words: CONDITION, CURDATE, DATE).
For more SPSS technical tips, please visit the SPSS Technical Support Web site at http://support.spss.com/.
Predictive Analytics
can make your organization
more
successful