EDIT: Editing a Value According to a Format (SQL)

How to:

The EDIT function edits a numeric or character value according to a format specified by a mask. (It works exactly like the EDIT function in FOCUS.)

A 9 in the mask indicates the corresponding character in the source value is copied into the result. A $ in the mask indicates that the corresponding character is to be ignored. Any other character is inserted into the result.


Top of page

x
Syntax: How to Edit a Value According to a Format
EDIT(arg, mask)

where:

arg

Numeric or character string

Is the value to be edited.

mask

character string

Indicates how the editing is to proceed.

This function returns a character string whose length is determined by the mask.



Example: Editing a Value According to a Format

EDIT extracts a character from a string. This example,

EDIT('FRED'        , '9$$$')

returns F.

This example,

EDIT('123456789', '999-99-9999')

returns 123-45-6789.


iWay Software