Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula help

Status
Not open for further replies.

JasonMcConnell

Technical User
Mar 10, 2005
29
GB
Hi Guys I am trying to search a memo file in Crystal XI
I have tried the following formulas
{Description} like “Brown”
{Description} like “*Brown*”
{Description} like “ * Brown * ”
But get no results? I know there are records with this in the description?
Can you help?
 
Create a formula fields with the following syntax:

"Brown"${table.description}

Then in the query expert search for the formula to be equal to true.

-------------

Once you get that to work, create a parameter and substitute it for "brown".



Howard Hammerman,
Crystal Training and Crystal Material
On-site classes and one-on-one coaching
Low-cost telephone/email support
FREE independent Crystal newsletter
howard@hammerman.com
800-783-2269
 
{Description} like “*Brown*” should work--unless you are trying to do this in a command, in which case you would instead use:

{Description} like '%Brown%'

You might also need to take into consideration the case. If this can be an issue, in a command, you would use:

where ucase(table.`description`) like '%BROWN%'

If you are doing this within the CR GUI, the best solution is to create a SQL expression {%desc}:

ucase(table.`description`)

Then use a record selection formula like:

{%desc} like '*BROWN*'

If you are using a parameter instead of a hard coded name/color, then you should enclose the parameter in quotes and use the plus sign, as in:

{%desc} like '*'+{?Color}+'*'

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top