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!

Parameter and Like Operator 1

Status
Not open for further replies.

Bennie47250

Programmer
Nov 8, 2001
515
US
Using Crystal version 7.0
On an MS SQL table

Have a report and one of the parameters prompts for a part number. Since we have different part number for the same item except for the color, (widgetBK, widgetBL widgetRD) I have make the selection an like operator to allow the user to enter the part number like widget* to get all the colors.

Now sometimes we will want to know how many widgetBK we have sold. When I run the report and enter widgetBK, no records are returned. However, if I enter it as widgetBK* records are returned.

Is this the correct behavior? Is there a workaround to not have to include the * for an exact match?

Thanks
Bennie
 
Hi,
If you are using the LIKE operator the wild card is needed, if I remember correctly, since it is a pattern operator.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Why wouldn't you be setting up the asterisk in the selection formula instead of entering it at the prompt?

{table.field} like {?Parameter}+"*"

I think this would accept both exact and inexact matches.

-LB
 
Thanks Turkbear, guess this is expected behavior.

Lbass, guess I have never done it that way as I never would have thought of that in 100 years. That I why I appreciate you and the other experts here!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top