<< Click to Display Table of Contents >> Navigation: Available Functions > At() |
Syntax
At( <CharacterValue1>, <CharacterValue2> )
Purpose
This function allows you to search a character field or value for the first instance of a specified character sequence, and it will return the starting position as a numeric value.
Parameters
<CharacterValue1> is the character value to locate within <CharacterValue2>. <CharacterValue1> is usually a specific character value which you define by enclosing characters of your choice in quotation marks.
<CharacterValue2> is the character value to be searched. This is usually the name of a database field of character type.
Returns
A Numeric value. If <CharacterValue1> is contained within <CharacterValue2>, At() returns the starting character position that <CharacterValue1> occurs at in <CharacterValue2>. If <CharacterValue1> is not found within <CharacterValue2>, then At() returns 0.
Usage
You can use this function to create Selection conditions which will Select donors based on where in a particular field a specific sequence of characters occurs.
Example
You've found that one of your data entry people entered "Dr." as the last word in the Salutation1 field for some donors, when you really wanted it to be the first word in the salutation1 field for those same donors. What you need to find out is which donors have the value "Dr." starting at a character position of two or more in the Salutation1 field. This can be determined by creating a Custom Selection condition like this:
At( "Dr.", .Salutation1. ) >= 2
This condition will be true for all donors who have the character value "Dr." occurring in the Salutation1 field at a character position greater than or equal to 2. This function could also be used to search for key words within memo text line.