Previous Topic

Next Topic

Trim - SQL Function

TRIM ([LEADING|TRAILING|BOTH] FROM String: String): String

Trim returns String with either leading, trailing or both spaces removed, as specified. TRIM can only be used with string or memo fields or constants.

Trim function syntax has these named arguments:

Parameter

Description

Position

Required. Select from:

  • Leading - delete all spaces at the left end of the string.
  • Trailing - delete all spaces at the right end of the string.
  • Both - delete all spaces at both ends of the string.

String

Required. String to be trimmed.

The following are examples of using the TRIM function:

  TRIM(LEADING FROM ' ABC ') - will return 'ABC '

  TRIM(TRAILING FROM ' ABC ') - will return ' ABC'

  TRIM(BOTH FROM ' ABC ') - will return 'ABC'

See Also

SQL String Functions

Book Contents

Book Index