AT( ) function

Returns a number specifying where a particular occurrence of a search string starts within a character string.

Syntax

AT(occurrence_num, search_for_string, within_text)

Parameters

occurrence_num

Numeric. The occurrence of the search string to search for.

search_for_string

Character. The search string to search for. This parameter is case-sensitive.

within_text

Character. The value to search in.

Output

Numeric. Returns the starting byte position of the specified occurrence of the search_for_string value, or 0 if no matches are found.

Remarks

You can use this function to retrieve the position of a string, or if you are looking for multiple occurrences. If you just want to determine whether a string is present, the FIND( ) function is a better alternative.

If the value of the occurrence_num parameter is greater than the actual number of occurrences in the string, the function returns 0 because it cannot find that occurrence of the string. If the value of the search_for_string parameter includes double quotation marks, you need to enclose the parameter in single quotes (i.e., ‘”’).

Examples

Example Return value

AT(1,“B”,“ABCDED”)

2

AT(2,“-”,“604-669-4225”)

8

AT(4,“a”,“Alabama”)

0

The return value is 0 because there is not a fourth lowercase “a” in the string.

AT(1,“ISS”,“Mississippi”)

0

The return value is 0 because the uppercase “ISS” does not match lowercase “iss”.

Related reference
FIND( ) function
UPPER( ) function


(C) 2013 ACL Services Ltd. All Rights Reserved. | Send feedback