LEFT

Description

Returns a substring containing the specified number of characters from the beginning (left side) of the provided string. If num_chars exceeds the string length, the entire string is returned.

Syntax

LEFT(string, num_chars) -> String

Parameters

ParameterData TypeRequiredDescription
stringStringYesThe string to extract characters from.
num_charsIntegerYesThe number of characters to extract from the left.

Examples

LEFT(CaseNumber, 3)
-- Returns the first 3 characters from CaseNumber.
LEFT("Q2Report", 20)
-- Returns the entire string "Q2Report" since 20 exceeds its length.

Tips

  • num_chars must be a non-negative integer. If num_chars is 0, an empty string is returned.