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!

Using the Like Operator in Crystal XI

Status
Not open for further replies.
Jul 6, 2010
5
US
I have 2 parameters that I am trying to use with the "like" operator. Below is my formula:

{Command.firstname} like '*' + {?@firstname} + '*' and
{Command.lastname} like '*' + {?@lastname} + '*'

I want the individual to be able to type some letters of the first and last names?

Please help me out!!

Thanks!
 
I believe the syntax would be {Command.firstname} like ({?firstnmae} + "*") and {Command.lastname} like {?lastname} + "*")

With the @, you are indicating a formula. I don't believe you can have a formula as a parameter.
 
That's how the parameter is printed in Crystal with the "@" in front of it. That didn't work. Thanks a bunch though!!
 
What is your question as you code will work.

I have just tested on CR10 and all OK.

Ian
 
I am not returning any data using the formula I currently have? If I only type 'sus' for firstname and 'sing' for last name and I not returning any data? What am I doing wrong?
 
Possibly a case issue convert everything to uppercase

uppercase({Command.firstname}) like '*' + uppercase({?@firstname}) + '*' and
uppercase({Command.lastname}) like '*' + uppercase({?@lastname}) + '*'

Ian

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top