Name

left — Return the specified number of characters from the start of a string.

Syntax

left(string, width)
              

The LEFT function has the following arguments:

string

The string to extract the substring from.

width

The width of the substring to extract.

Description

Returns the first characters in a text string, based on the number of characters you specify. If the width is 0 or less then an empty string is returned. If the width is greater than the length of the string then the full string is returned.

Examples

Formula

Description

Result

left('foobar', 3)

Return the first 3 characters of 'foobar'

'foo'

left('foobar', -1)Return an empty string.''
left('foobar', 24)Return the full string.'foobar'