How to: |
The EDIT2 function converts a numeric, date, or date-time value to a character string based on a specified format. The format must be valid for the data supplied. The output is returned as variable length alphanumeric.
EDIT2(in_value, 'format')
where:
Numeric, date, or date-time
Is any numeric value or a date in either standard date or date-time format. If the date is given in standard date format, all of its time components are assumed to be zero.
Is a numeric, date, or date-time format enclosed in single quotation marks.
The following request defines a date field as YYMD format and converts it to a character string (CharDate) in YYMtrD format.
DEFINE FILE WF_RETAIL_LITE DATE1/YYMD = TIME_DATE_DAY_COMPONENT; CharDate/A20 = EDIT2(DATE1,'YYMtrD'); END TABLE FILE WF_RETAIL_LITE SUM COGS_US BY CharDate WHERE TIME_MTHNAME EQ 'FEB' ON TABLE SET PAGE NOLEAD END
The output is shown in the following image.