Hi Steve,
Be aware that a SQL Expression is another data query so it can affect performance and in your case I don't see any advantage in using one.
I also DO NOT agree that SELECT statements should be used in SQL Expression, they are more of a Function to process rather than a SQL statement.
So maybe explain why you want to use them?
Here's how to use a Dynamic Parameters ( with filtering and Ranges too )
What you are doing is already built into CR Parameters. Rather than building your own query create a new Parameter and make it Dynamic.
Here's how to:
Create a new report and connect to your data. I'm using the Xtreme database and Customer, Order and Order details:
Add a few fields into the detail section and Group on Customer Name:
Create a new Parameter and make it Dynamic and set the field to the Customer Name and select your Parameter Name in the Parameters list:
Now you want to add record selection formula so it filters on what you selected:
{Customer.Customer Name} = {?MyDynamic}
Now when you refresh you get this:
To add filtering click on the little yellow icon:
And enter in ABC ( not this is not case sensitive so it will return all records, the more characters you enter the better. I entered "ba" and I now see this:
So this limits the selection to only one Company Name.
If you want to allow ranges change the Parameter and set the Range to True:
Now you can select and filter on multiple values. First filter I set to "7" and second filter I set to "ba"
Now I see this in the drop down:
Hope that helps?
Don