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

Using one parameter to select multiple values

Status
Not open for further replies.

kwood1985

IS-IT--Management
Feb 24, 2020
3
GB
I need some help in how I can get my current report generating correctly.

I need my report to display particular data stored in the database under a particular location, and the parameter I would use is based on that locations number, so in this case, the locationtype column = 21, which is for the location of Hertfordshire storage.

So when the parameter is used it will select any column data that had the locationtype of 21. But for my case the location of Hertfordshire storage as been added 4 times under four different locationtype numbers, so what I am trying to do is, when the parameter is selected, it displays all data related to those four locationtypes.

Hope this makes sense. Any help and advice will be greatly appreciated.
 
I do not have crystal in front of me right now, but you would use something like this in your selection criteria (sorry for any typos/errors):

If YOURPARAMETER = '21' then locationtype in ('1','2','3','4')
else locationtype = YOURPARAMETER
 

Thank you for your response.

I have tried this but I am getting an issue where it is saying it is missing a ')' after the first number in the 'in()' section. I have tried with '', "" and none, but still states the same issue.

I think what might be the easiest way is to create the parameter as a multi value parameter so the user can select each locationtype
 
You need to use square brackets ([]). If you spend any time with SQL they use parenthesis, easy to forget.
 
Yes, thank you...it is easy to forget lol...well for me anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top