How to: |
The EDIT function converts an alphanumeric field that contains numeric characters to numeric format or converts a numeric field to alphanumeric format.
This function is useful for manipulating a field in an expression that performs an operation that requires operands in a particular format.
When EDIT assigns a converted value to a new field, the format of the new field must correspond to the format of the returned value. For example, if EDIT converts a numeric field to alphanumeric format, you must give the new field an alphanumeric format:
DEFINE ALPHAPRICE/A6 = EDIT(PRICE);
EDIT deals with a symbol in the following way:
Any other non-numeric characters are invalid, and EDIT returns the value zero.
EDIT also extracts characters from or add characters to an alphanumeric string. For more information, see EDIT: Extracting or Adding Characters.
EDIT(fieldname);
where:
Is the field name.
EDIT converts HIRE_DATE (a legacy date format) to alphanumeric format.
EDIT(HIRE_DATE)
For 82/04/01, the result is 820401.
For 81/11/02, the result is 811102.
iWay Software |