LEFT

The LEFT function returns a specified number of characters from a text expression beginning with the leftmost byte of a text item.

You can use LEFT when you need a specific part of a text item. For example, a customer number might have several uses and sometimes only the first 10 characters are needed. Therefore, LEFT can be used to return only the leftmost 10 characters.

Syntax:
LEFT (single-text-expression , single-integer-expression)
Meaning:
LEFT (text_to_extract_from , number_of_characters_to_extract)
Returns:
A single text item

LEFT returns the leftmost number_of_characters_to_extract characters from text_to_extract_from starting at the first (the leftmost) character in text_to_extract_from.

If number_of_characters_to_extract evaluates to an integer whose value is less than 1, LEFT evaluates to "none". If number_of_characters_to_extract evaluates to an integer whose value is greater than the size of text_to_extract_from, LEFT evaluates to the entire value of text_to_extract_from.

Examples

  • LEFT ("Abcd", 2)

    Returns Ab

  • LEFT ("Abcd", 6)

    Returns Abcd

  • LEFT (LastName + ", " + FirstName, 25)

    Returns the leftmost 25 characters of the text string resulting from the concatenation of LastName and FirstName (separated by a comma and a space).

Related functions

  • RIGHT
  • MID
  • FIND