Remove duplicates items in drop down SSRS 2008
-
Friday, September 14, 2012 1:55 PM
Hi everybody,
I need remove duplicate item in drop down choice.
I can remove in rendering although of code ?
Robson Hasselhoff - Follow me @Robk9e
All Replies
-
Friday, September 14, 2012 2:28 PM
-
Friday, September 14, 2012 2:50 PM
Hello Olaf,
Already own separate dataset for each parameter, and is connected to the other.
example:
Dataset: List_site
SELECT DISTINCT FROM wakeonlan.tbl_total siteID | SITE
01 | Default-First-Site-Name
02 | Site-Secundario
Filters: None
Dataset: List_date
select distinct convert(VARCHAR(10),data,(105)) as data,site from wakeonlan.tbl_total
13-09-2012 Default-First-Site-Name
13-09-2012 Site-Secundario
14-09-2012 Site-SecundarioFilters: site IN @site
Dataset: show_data
SELECT id, m_ligadas, m_desligadas, m_lig_pos, m_des_pos, site, leva, CONVERT(VARCHAR(10), data, 105) AS data FROM wakeonlan.tbl_total
Filters:
site IN @site
data IN @data
Still out in duplicate as parameters :s
Robson Hasselhoff - Follow me @Robk9e
- Edited by Robson de Carvalho Friday, September 14, 2012 2:53 PM
- Edited by Robson de Carvalho Friday, September 14, 2012 2:54 PM
-
Friday, September 14, 2012 5:21 PM
Hi Robson,
The problem is where you're applying the filter. You're getting a distinct list of dates for each site (so the same date may appear more than once), then filtering out the ones for the selected site(s):
Remove the filter from the dataset and use this instead:
select distinct convert(VARCHAR(10),data,(105)) as data from wakeonlan.tbl_total where site in (@site)
Regards
James
Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.
- Edited by James Still Friday, September 14, 2012 5:22 PM
- Marked As Answer by Robson de Carvalho Saturday, September 15, 2012 3:36 PM
-
Friday, September 14, 2012 6:44 PM
Hi There,
The problem is with your query for List_date dataset. In this query, you are doing a distinct on two columns "convert(VARCHAR(10),data,(105)) as data" and "site" and as we can see from the above results which you posted, they are indeed distinct (combination is distinct). However, if you look at the first column alone (Data column), it has "13-09-2012" repeating twice but each one with a different "Site" value. Modify your query like this:
SELECT DISTINCT convert(VARCHAR(10),data,(105)) as data FROM wakeonlan.tbl_total
Hope that helps!
Best Regards,
Datta
----------------------------------------------------------------------------------------------------
Dattatrey Sindol
My Blog: Datta's Ramblings on Business Intelligence 'N' Life
The information provided here is "AS IS" with no warranties, and confers no rights.
Please mark the post as answered if it solves your problem. -
Saturday, September 15, 2012 6:02 AM
Take a look at this...
It's an easy, clean method that keeps you from having to add a 2nd datasouce.
HTH,
Jason Long
-
Saturday, September 15, 2012 3:36 PMTHanks J Still, that's it !!!
Robson Hasselhoff - Follow me @Robk9e
-
Saturday, September 15, 2012 3:37 PM
Hi Dattatrey
IF I used so would be inconsistent means, but thanks!
Robson Hasselhoff - Follow me @Robk9e
-
Saturday, September 15, 2012 3:38 PMHi Jason the solution of J Still solved my problem, but will test this method! thanks
Robson Hasselhoff - Follow me @Robk9e

