Database Reference
In-Depth Information
▪ The Left() function returns only the leftmost letters of a text value. You pass (that is,
tell) the calculation the actual text value to parse, and the number of letters you want. For
example, to get a person's initials, you can use a calculation like this:
Left ( First Name ; 1 ) & Left ( Last Name ; 1 )
To get the first three digits of a Social Security number, you can use this calculation:
Left ( SSN ; 3 )
▪ The Right() function does the same thing but starts from the other end of the text value.
If you want to record the last four digits of someone's credit card number, then you can
do it like this:
Right ( Credit Card Number ; 4 )
▪ If the information you want isn't on either end, you may need to use the Middle() func-
tion instead. This function expects three parameters. Just as when using Left() and
Right(), the first parameter is the text value FileMaker's inspecting. The second paramet-
er is the starting position. Finally, you tell FileMaker how many characters you want. (If
you're not sure whether to use Middle() instead of Left() or Right() , see the box on
The Middle Way .
For example, suppose you have a product database that uses a special coding system for
each item. The code “SH-112-M” indicates shirt style 112, medium size. To pull out just
the style number (that 112 in the middle of the product code), you want your calculation
to grab three characters from the Product Number field, starting with the fourth character.
Middle ( Product Number ; 4 ; 3 )
TIP
Use the Right() function to pad a number with leading zeroes (or any other character). For ex-
ample, the calculation Right ( “0000” & InvoiceID ; 5 ) puts two zeroes in front of InvoiceID
#789 (#00789), only one in front of #6789 (#06789), but none at all in front of #56789 (#56789).
Word Functions
FileMaker also understands the concept of words. With word functions, you don't have to
bother dealing with every single character.
In FileMaker's mind, a word is any stretch of letters, numbers, or the period character that
doesn't have any other spaces or punctuation in it. Most of the time, this definition means
Search WWH ::




Custom Search