Extracts a substring from an argument.
Category: | String |
Returned data type: | String |
MID(source,position<, length>)
source
specifies a string to search; this can be specified as string constant, field name, or expression
position
specifies an integer that is the beginning character position; this can be specified as a numeric constant, field name, or expression
length
specifies an integer that is the length of the substring to extract; this can be specified as a numeric constant, field name, or expression
Default | If length is omitted, the remainder of the string will be extracted. | |
Note | If length is NULL, zero, or larger than the length of the expression that remains in the source after position, the remainder of the expression is returned. |
source = "06MAY98"
result = mid(source, 3, 3) // outputs "MAY"
result = mid(source, 3) // outputs "MAY98"