Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Checking for Duplicates Post Reply Post New Topic
Author Message
cjbuechler
Newbie
Newbie
Avatar

Joined: 20 Mar 2007
Location: United States
Online Status: Offline
Posts: 2
Quote cjbuechler Replybullet Topic: Checking for Duplicates
    Posted: 24 Oct 2007 at 3:36pm
Before I complicate this request with details the point of this is to make a report that displays all entries in a table where the Contact field matches at least one other record's Contact field.


In SQL Query Analyzer I can do this:
select count(*),
  Contact
from Contact1
group by Contact
having count(*) > 1
order by count(*) desc

and I can at least see the name of the people I need to look into.

In MSACCESS I would have just grouped by Contact name and put the count in the group footer and hidden the entire grouping if it was under 2 but I can't seem to do that here.

I tried making a running total field off of Contact and only displaying the ones where it was larger than 2....but since the total count starts each time at 1 I can only display anything past the 2nd copy(3rd, 4th, and all additional).

So...whats the easiest way to do something like this??


Edited by cjbuechler - 24 Oct 2007 at 3:37pm
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 25 Oct 2007 at 11:46am
The problem, as you found out, is that CR only knows if the count is >1 AFTER is has printed the detail records and this is too late. I would take your SQL statement and put it in a Command object. That way you only get the data with counts > 1 to report on.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.