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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a parameter value to a select record

Status
Not open for further replies.

outra9e

Programmer
Oct 2, 2001
31
GB
Hi guys

I am trying to pass a parameter to a report.

Basically the customer needs to be able to type in the first word of a customer name and pull back a report on only the records with that name.

I have set up the parameter field and have set up a formula. The only way I can get it to work is to set the formula to be a left statement of the field for customer name in this case I do it for three characters and then it works, but it isn't specific enough. can anyone help?

I think that the formula needs to be that the customer name field = the parameter field, but this doesn't work.
 
Well it SHOULD work!
I assume that your param field is of type character.
Let's call it: GetName

Try this in your select statement:

Trim({?GetName}) like {Table.Field)

or perhaps

{Table.Field) startswith {?GetName}




Howard Hammerman,

Crystal Reports training, consulting, books, training material, software, and support. Scheduled training in 8 cities.
howard@hammerman.com
800-783-2269
 
I also use STARTSWITH. I define my param with a MAX and MIN LENGTH of 1 character and pull all records that start with that char (from a char field, length of 9) without a problem.
 
If you've already created the parameter, say p_name:

1. Go to the Report menu
2. Choose Select Export menu item
3. A dialog box pops up with all of the fields
4. Pick the database field you want to match
5. A new dialog box shows up with 3 drop-downs, the left-most being the db field you just choose
6. In the middle drop-down, pick "Starts with"
7. In the right drop-down, pick "?p_Name"

That's it.
 
Well thanks for your input guys

I have taken the "startswith" route.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top