How to: |
Available Languages: reporting
The TODAY function retrieves the current date from the operating system in the format MM/DD/YY or MM/DD/YYYY. It always returns a date that is current. Therefore, if you are running an application late at night, use TODAY. You can remove the default embedded slashes with the EDIT function.
You can also retrieve the date in the same format (separated by slashes) using the Dialogue Manager system variable &DATE. You can retrieve the date without the slashes using the system variables &YMD, &MDY, and &DMY. The system variable &DATEfmt retrieves the date in a specified format.
TODAY(output)
where:
Alphanumeric, at least A8
Is the name of the field that contains the result, or the format of the output value enclosed in single quotation marks.
The following apply:
TODAY retrieves the current date and stores it in the DATE field. The request then displays the date in the page heading.
DEFINE FILE EMPLOYEE DATE/A10 WITH EMP_ID = TODAY(DATE); END
TABLE FILE EMPLOYEE SUM CURR_SAL BY DEPARTMENT HEADING "PAGE <TABPAGENO " "SALARY REPORT RUN ON <DATE " END
The output is:
SALARY REPORT RUN ON 12/13/2006 DEPARTMENT CURR_SAL ---------- -------- MIS $108,002.00 PRODUCTION $114,282.00