Operation Manual
Record Selection
Troubleshooting record selection formulas
9
Crystal Reports User’s Guide 165
9. Once the selection formula with two selectors activated is working
properly, add a third selector, then a fourth, and so on, until you have
tested each selector in the selection formula.
Correcting selections that do not generate data
You may encounter a situation in which you create a record selection formula
and, while header and footer information prints on your report, no detail
information appears. The problem is the selection formula is rejecting all records.
This usually occurs because of an error in the creation of the selection formula.
There are a couple of potential causes of your problem in the selection formula:
• See “Correcting uppercase/lowercase inconsistency” on page 165.
• See “Unwanted spaces appear in selection formula” on page 166.
• See “Using If statements in selection formulas” on page 166.
Correcting uppercase/lowercase inconsistency
Record selection formulas are case sensitive. That is, “Bob” matches only
with “Bob”. It does not match with “bob”, “BOB”, “BoB”, “bOB”, “boB”, or
“BOb”. Thus, if your selection formula is set to include only those records with
“BOB” in the {customer.CONTACT FIRST NAME} field, but all the entries in
the {customer.CONTACT FIRST NAME} field are mixed case (“Bob”, for
example), the selection formula will find no matches and thus will not print any
details for the report.
You can solve this problem by using the UpperCase (str) or LowerCase (str)
functions in your selection formula to convert field data to a consistent case
before the program begins its selection. For example, if you were using this
formula:
{customer.CONTACT FIRST NAME} = "BOB"
you can change the formula to this:
UpperCase({customer.CONTACT FIRST NAME}) = "BOB"
This second formula first converts the value of the {customer.CONTACT
FIRST NAME} field to upper case characters and then checks to see if the
resulting value in that field is equal to “BOB”. Using this formula, any instance
of the three letters “b,” “o,” and “b” will be a match, regardless of case,
because the case will be converted to uppercase.
You could use the LowerCase function in a similar manner to match with “bob.”
Check your selection formula closely and make sure you have the correct
case for any text you are trying to match. If in doubt, use the UpperCase (or
LowerCase) function to assure consistency and proper matching.