Unwanted spaces appear in selection formula – HP Intelligent Management Center Standard Software Platform User Manual

Page 206

Advertising
background image

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.

Another formula which performs much the same functions is the following:

"BOB" in UpperCase({customer.CONTACT FIRST NAME})

Unwanted spaces appear in selection formula

Spaces are characters, and when you include spaces in the search key of
a record selection formula, the formula looks for records with the exact match
in the selected field, spaces and all. For example, the following formula:

"Mr . " in {customer.TITLE}

will not find any matches with the form of address "Mr." because there is an
extra space in the search key between the letter "r" and the period. Likewise,
"Ph. D" will not match "Ph.D".

206

Crystal Reports 2008 SP3 User's Guide

Record Selection

9

Troubleshooting record selection formulas

Advertising