String Functions

ASCII(string)

Return the ASCII code for the first character of string. For example, ASCII('A') = 65

CHAR(number)

Returns the character encoded by the ASCII code number. For example, CHAR(65) = 'A'

Contains(string, substring)

Returns true if the given string contains the specified substring. CONTAINS(“Calculation”, “alcu”) = true

ENDSWITH(string, substring)

Returns true if the given string ends with the specified substring. Trailing white spaces are ignored. ENDSWITH(“Tableau”, “leau”) = true

FIND(string, substring, [start])

Returns the index position of substring in string, or 0 if the substring isn't found. If the optional argument start is added, the function does the same thing, but ignores any instances of substring that appear before the index position start. The first character in the string is position 1. For example, FIND("Calculation", "alcu") = 2 FIND("Calculation", "Computer") = 0FIND("Calculation", "a", 3) = 7FIND("Calculation", "a", 2) = 2FIND("Calculation", "a", 8) = 0

LEFT(string, number)

Returns the left-most number of characters in the string. For example, LEFT("Matador", 4) = "Mata"

LEN(string)

Returns the length of the string. For example, LEN("Matador") = 7

LOWER(string)

Returns the lower case version of the string. For example, LOWER("ProductVersion") = "productversion"

LTRIM(string)

Returns the string with any leading spaces removed. For example, LTRIM(" Matador ") = "Matador "

MAX(a, b)

Usually applied to numbers, but also works on strings. Returns the maximum of a and b (a and b must be of the same type). With strings, MAX finds the value that is highest in the sort sequence defined by the database for that column. It returns Null if either argument is Null. For example, MAX ("Apple","Banana") = "Banana"

MID(string, start, [length])

Returns the string starting at index position start. The first character in the string is position 1. If the optional argument length is added, the returned string includes only that number of characters. For example, MID("Calculation", 2) = "alculation"MID("Calculation", 2, 5) ="alcul"

MIN(a, b)

Usually applied to numbers, but also works on strings. Returns the minimum of a and b (a and b must be of the same type). With strings, MIN finds the value that is lowest in the sort sequence. It returns Null if either argument is Null. For example, MIN ("Apple","Banana") = "Apple"

REPLACE(string, substring, replacement)

Searches the provided string for the given substring and replaces it with the replacement. If the substring is not found, the string is unchanged. For example, REPLACE("Version8.5", "8.5", "9.0") = "Version9.0"

RIGHT(string, number)

Returns the right-most number of characters in string. For example, RIGHT("Calculation", 4) = "tion"

RTRIM(string)

Returns the string with any trailing spaces removed. For example, RTRIM(" Calculation ") = " Calculation"

SPACE(number)

Returns a string that is composed of the specified number of repeated spaces. For example, SPACE(1) = " "

STARTSWITH(string, substring)

Returns true if the given string stars with the specified substring. Leading white spaces are ignored. For example, STARTSWITH(“Joker”, “Jo”) = true

TRIM(string)

Returns the string with leading and trailing spaces removed. For example, TRIM(" Calculation ") = "Calculation"

UPPER(string)

Returns the lower case version of the string. For example, UPPER("Calculation") = "CALCULATION"