SQL Expression for SubString

TECH TIP: SQL Expression for SubString

SQL Expressions can be entered via the Calc page of RB’s Query Designer. Select a field and then select Expression as the function type. Type in the desired expression.

Most database engines support built-in SQL expressions for functions such as SubString. Consult the database product’s documentation for a full list.

The ANSI specification for SQL2 defines a SubString expression that is supported by many database engines:

where Source is the string, n is that starting character position of the substring, and len is the length of the substring).

Example using DBDemos: