Solved

SSRS Highlight Dulpicates

Posted on 2010-08-31
3
1,269 Views
Last Modified: 2012-05-10
I need to show or highlight duplicate telephone numbers in my report.

I've tried doing i tin the sql script but the results are ot correct.
0
Comment
Question by:aneilg
3 Comments
 
LVL 10

Accepted Solution

by:
itcouple earned 250 total points
Comment Utility
Hi

Identifying them in your dataset might be the easiest option. IsDuplicate (true/false). What was the issue with your SQL?

You can usually do self-join for this kind of tasks. This works fine based on Microsoft Adventure works database... a lot of duplicated phone numbers in their db :)
SELECT     C1.CustomerKey, C1.Phone, CASE COUNT(C2.Phone) WHEN 1 THEN 0 ELSE 1 END AS IsDuplicated
FROM         DimCustomer AS C1 INNER JOIN
                      DimCustomer AS C2 ON C1.Phone = C2.Phone
GROUP BY C1.CustomerKey, C1.Phone

Let me know if that helps in your case

Regards
Emil
0
 
LVL 9

Assisted Solution

by:sureshbabukrish
sureshbabukrish earned 250 total points
Comment Utility
if the dataset is sorted by telephone numbers in the report,you can use [previous] function in expression to determine whether the phone number is a duplicate of the previous one and then you can highlight it.

if it is not sorted, then you need to create a function which accepts the phone number as a parameter and tells you whether it is duplicated or not. you can use the function in your select query
0
 

Author Comment

by:aneilg
Comment Utility
Thanks for your help guys.

I've had a look at both solutions and they are both good.

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Written by Valentino Vranken. A while ago I wrote an article called Chart Optimization Tips (http://www.experts-exchange.com/articles/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Chart-Optimization-Tips.html).  This article explained how …
After much searching across the internet I have found that you could not set the name of the file you were attaching to dynamic report subscriptons in Microsoft Reporting Services. I did manage to find one article showing you how your could make a s…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now