Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: How to get a distinct Summary from joined tables Post Reply Post New Topic
Author Message
flanman
Senior Member
Senior Member
Avatar

Joined: 04 Nov 2009
Online Status: Offline
Posts: 123
Quote flanman Replybullet Topic: How to get a distinct Summary from joined tables
     Posted: 15 Dec 2009 at 3:24pm
I have two tables that are joined and I am trying to get a correct summary for 3 different fields, but my totals are way out of wack. Here is what is what I mean:
Table1 -
AccountID, Numfield1
Table2
AccountID, Numfield2, Numfield3

when I try to group by the AccountID and summarize I get this:

Account ID               Field1           Field2           Field3
1111                         5                     20                30
1111                         10                   20                30       
1111                          5                     10                 8          
1111                          10                   10                 8
1111                         5                      0                  25
1111                         10                    0                  25

Totals now               45                   60                 126

Should be                  15                    30               63              

If I do a summary with only either of just one table I get my summaries fine,
but when I add the second table the summaries double as does my total number of records. How can I setup the summaries to work correctly?

Thanks,

Flanman



IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 15 Dec 2009 at 4:09pm

Is there another field, probably in Table2, such as a date field, that will help identify each unique value?  For example, a date or invoice number or something of the sort.  If there is, I know how to do this.

-Dell
IP IP Logged
flanman
Senior Member
Senior Member
Avatar

Joined: 04 Nov 2009
Online Status: Offline
Posts: 123
Quote flanman Replybullet Posted: 15 Dec 2009 at 6:09pm
Are you looking for a field that is only in table two ? Obviously the AccountID is in both tables. There is a field (ShiftID) that is only in table two that would be shared by the field 2 and field 3.

Bill
IP IP Logged
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