Crystal Reports – How to test if string contains

The following formula shows how to test if a text field contains particular text.

For example:

a quick brown foxInStr( {value}, ‘red’ )false
a quick brown foxInStr( {value}, ‘brown’ )true

Note: the InStr function is case sensitive – if you want to test case insensitive you need to convert the value to lowercase first. For example

InStr( lcase( {value} ), 'brown' ) > 0


Was this article helpful?

Related Articles