Topic: Searching string with spaces Posted: 16 Jul 2012 at 12:37pm
I have a report that searches a large text field for certain keywords based on a list of reportable events. One of the terms I am looking for is 'ER' as in emergency room. In my Record Selection Formula I have
...
or " ER " in {COMP_PROD_DESC.COMP_PROD_DESC_TXT}
or " ER." in {COMP_PROD_DESC.COMP_PROD_DESC_TXT}
...
among all the other terms. In the results I am getting events back that do not have 'ER' by itself rather -er as part of another word; i.e. customer, determined, etc.
I have tried:
"* ER *"
"*ER*"
"?ER?"
and I still get the same results. From the behavior I am seeing it seems as though the spaces around ER are being trimmed when provided in a string.
Please help! I am on a tight deadline with updating this report and another similar one. We do not want these to show up in the report as events. I also tried using SQL syntax including spaces and wildcard, but CR did not accept it when trying to save. I am using CR 9.
After doing some further testing, I found that spacing is actually respected in literal strings. To solve my issue with the ER example I used UpperCase because Crystal is case sensitive
" ER " in UpperCase({COMP_PROD_DESC.COMP_PROD_DESC_TXT})
To be consistent I updated all my literal strings to uppercase and used UpperCase() before my field name{}.
Through this I also found that neither * nor % can be used as wildcards. They are recognized as literals at least in Crystal 9.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum