Use the @STRFIND
function to determine the position of a string within a string column or else return zero if not found. Optionally, @STRFIND
can accept a starting position to search within the string.
Syntax
result = @STRFIND (string, "search_string" [, begin_position])
string
The string from which to extract. The string can be either the name of a column or a literal string. Enclose literals within quotes.
"search_string"
The string for which to search within the string. Enclose the search string within quotes.
begin_position
The character position at which to begin searching.
Example
Assuming the string for ACCT
is ABC123ABC
, the following are possible results.
result = @STRFIND (ACCT, "23") returns 5. result = @STRFIND (ACCT, "ZZ") returns 0. result = @STRFIND (ACCT, "ABC", 2) returns 7.