Operation Manual
Record Selection
Using formula templates
9
160 Crystal Reports User’s Guide
5. Use the Select Expert to change your selection formula.
6. Review the updated formula by clicking the Show Formula button again.
7. To make changes to the formula, click the Formula Editor button in the
expanded Select Expert and use the tools in the Formula Workshop to
make your formula changes.
Note: Selection formula components that do not fit any of the fixed criteria in
the Select Expert will not be translated. For example, if part of your record
selection formula extracts the last four characters in a customer number, the
section of the formula code that performs that extraction will not be converted
to Select Expert selection criteria.
Using formula templates
Record selection formula templates
The following sample formulas can be used as templates to help you create your
own selection formulas using the Formula Workshop. These examples illustrate
different selections that you could do, not necessarily the best selections.
Selecting records using character strings
{file.FIELD} startswith "C"
Selects those records in which the value in the {file.FIELD} field
begins with the character “C” (includes values like CyclePath, Corp.
and Cyclist’s Trail Co.; excludes values like Bob’s Bikes Ltd. and
Feel Great Bikes, Inc.).
not ({file.FIELD} startswith "C")
Selects those records in which the value in the {file.FIELD} field does
not begin with the character “C” (includes values like Bob’s Bikes Ltd.
and Feel Great Bikes, Inc.; excludes values like CyclePath, Corp.
and Cyclist’s Trail Co.).
"999" in {file.FIELD}[3 to 5]
Selects those records in which the 3rd through 5th digits of the
{file.FIELD} field is equal to “999” (includes values like 10999, 70999,
and 00999; excludes values like 99901 and 19990).
"Cycle" in {file.FIELD}
Selects those records in which the value in the {file.FIELD} field
contains the string “Cycle” (includes values such as CyclePath Corp.
and CycleSporin, Inc.; excludes values like Cyclist’s Trail Co. and
Feel Great Bikes, Inc.).