CURRENT_DATE macro
The CURRENT_DATE macro is available in IBM® Campaign and IBM® Interact.
Syntax
CURRENT_DATE([format])
Parameters
format
One of the keywords in the following table specifying the date format of date_string.
*
Description
CURRENT_DATE returns the current date in format. The date is determined by the clock on the IBM® server. If no format keyword is supplied, the default of DELIM_M_D_Y is used.
For all recommended databases, IBM® Campaign attempts to run the CURRENT_DATE macro in the database using a database-supported current time SQL call (e.g., SYSDATE, GETDATE, DATE, or TODAY). In these cases, all parameters (including the format of the date) of this macro function are ignored and the output includes whatever is returned by the database (e.g., a time component may be included in the output). If this occurs and you want to return just the date or the date in a different format, you can write your own custom macro using raw SQL or use other IBM® macros. For example:
DATE_STRING(CURRENT_JULIAN( ), ...)
In some cases, the CURRENT_DATE() macro is run on the IBM® Campaign server (e.g., if running against a flat file, against a non-recommended database with no equivalent SQL support, or if the Campaign macro expression cannot be resolved in the database). In these cases, all parameters are recognized and the output is returned in the selected format.
*
Not all formats available in IBM® Campaign are supported by IBM® Interact.
Note that you might have to use the DATE_FORMAT macro to adjust the CURRENT_DATE for your database type. For example, the following macro works with DB2:
table_name = CURRENT_DATE()-1
However, for Oracle, you must use the DATE_FORMAT macro as follows:
table_name = DATE_FORMAT(CURRENT_DATE()-1, DELIM_M_D_YYYY,'%Y-%m-%d')
Examples
If the date today is the 13th of September, 2015, CURRENT_DATE() returns "09/13/15".
Related functions