Skip to main content
Workday User Guide
Last Updated: 2023-06-23
SUBSTRING

SUBSTRING

Description

SUBSTRING
is a row function that returns the specified characters of a
TEXT
value based on the given start and optional end position.

Syntax

SUBSTRING
(
search_string
,
start
,
end
)

Return Value

Returns one value per row of type
TEXT
.

Input Parameters

search_string
Required. The name of a field or expression of type
TEXT
(or a literal string).
start
Required. An integer that specifies where the returned characters start (inclusive), with 0 being the first character of the string. If
start
is greater than the number of characters, then an empty string is returned. If
start
is greater than
end
, then an empty string is returned.
end
Optional. A positive integer that specifies where the returned characters end (exclusive), with the
end
character not being part of the return value. If
end
is greater than the number of characters, or is not specified, then the whole string value (from
start
) is returned.

Examples

Return the first letter of the
name
field:
SUBSTRING([name], 0, 1)
Return only the middle 3 digits with no hyphens of a US phone number in the format,
123-456-7891
:
SUBSTRING([us phone number], 4, 7)