LEFT Function

Returns the leftmost characters of a string.

Category: String
Returned data type: String

Syntax

LEFT(source, count)

Arguments

source

a string to be searched; this can be specified as string constant, field name, or expression

Note: If source is NULL, the function returns a NULL value.

count

an integer that specifies how many characters to return; this can be specified as numeric constant, field name, or expression

Note: When a count of zero is specified, an empty string is returned.

Example

source = "abcdefg"

result = left(source, 4) // outputs the string "abcd"