String functions |
The Functions choice lets you specify the value assigned to a string item for each row in the query or report in terms of rules that you define. You can apply any of the string functions to a data item or to the result of a string function. For example, you can extract a substring from a data item and then use the appropriate concatenate operator for your database to combine it with another data item, string, or substring.
Substring
SubStr() Substring
You can extract a group of adjacent characters from a table item or a user-defined table item which is itself a string. A substring can begin at any character position in a string, and can extend for any number of characters from 1 to the remaining length of the string. For example, assume you want to create an item made up of the characters in the fourth, fifth, and sixth positions of some other string item. To do so, you would select SubStr() and specify that the substring begins in position 4 of the underlying string item and extends for three characters.
Concatenate
Connects the value of the data item to the end of the value of another data item or user-defined data item. There will not be any spaces between the two values. To insert a space between values, concatenate a space in the statement. The concatenate function is ||.
EXAMPLES:
EQ_MAIN.EQ_equip_no || ‘ ‘ || EQ_MAIN.manufacturer
Result: ‘A1234 CHEVY’
EQ_MAIN.EQ_equip_no || EQ_MAIN.manufacturer
Result: ‘A1234CHEVY’