Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Duplicates Post Reply Post New Topic
Author Message
aeromonte
Newbie
Newbie


Joined: 25 Feb 2008
Location: United States
Online Status: Offline
Posts: 18
Quote aeromonte Replybullet Topic: Duplicates
    Posted: 25 Feb 2008 at 7:06am
Would appreciate anyones help with a design problem I can't figure out.
I am new to Crystal and the problem I am having is:
 
I am trying to pull data from 2 tables - from an OrderHead table and an OrderDetail table. 
I need all the order numbers pulled just ONCE from the orderhead table and need a department group number from the orderdetail table.  The problem is that the order detail table has multiple lines per order - so when I add the department group number, I am getting multiple order  numbers due to the multiple lines from the orderdetail table. 
The department group number is only in the order detail table.
 
In Access, I would have just used a "first" function for the department group number, but in Crystal I can't seem to find out how to do this.  It seems like it would be simple, but just can't seem to get it to work..
 
Any help would be much appreciated!
Thanks
John
IP IP Logged
saoco77
Senior Member
Senior Member


Joined: 26 Jun 2007
Online Status: Offline
Posts: 104
Quote saoco77 Replybullet Posted: 25 Feb 2008 at 10:15am
One way around this problem may be to suppress the duplicate rows of data.

In the section expert try suppressing this section using a formula similar to this:

{OrderDetail.ID)=previous({OrderDetail.ID})

Hope this helps,
Sarah
IP IP Logged
aeromonte
Newbie
Newbie


Joined: 25 Feb 2008
Location: United States
Online Status: Offline
Posts: 18
Quote aeromonte Replybullet Posted: 25 Feb 2008 at 10:41am

Sarah, thanks for your help. 

I tried this in the field format and what it did was the same thing as "suppress if duplicated" does in Crystal XI.  It hides the duplicates, but does not exclude them.  I found a few other things on DISTINCT - so need to look into that.  This might be what I am looking for. 
 
Thanks again!
John
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 25 Feb 2008 at 2:05pm
Do you know SQL well enough to write your own query in the Command object? I couldn't tell you the exact query off the top of my head (some type of query using MAX and Group By combination), but that is where I would start.
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.039 seconds.