I have my 2 datasets and my parameter set up to display building to select from. My issue is I get multiple values in the Select Value Prompt. It will pull the correct data I just want to clean up the Select Value Prompt.
Example:
Building 1
Building 1
Building 1
Building 2
Building 2
Dataset 1:
Select *
From Table
Dataset 2:
SELECT *
From Table
WHERE (Table.Building = @.Building)
ORDER BY Client.ctg
I'm assuming that you're using Dataset1 to populate the parameter. If so, try using the keyword DISTINCT in your SQL query for Dataset1.
SELECT DISTINCT
BuildingNameField
FROM Table (NoLock)
ORDER BY BuildingNameField
The "nolock" (also written as "with nolock") insures that the table isn't locked while running the query. I always use this as a general practice when I'm running a query that really doesn't need to lock the table.
About 99.9% of the time, I always create a seperate dataset for parameters. This way, if you need to make changes to the dataset, you don't have to worry about screwing up data for something else.
Thanks,
Micheal
No comments:
Post a Comment