Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cr 8.5 formula issue - duplicate rows created

Status
Not open for further replies.

catchingup

Technical User
May 11, 2006
37
US
I am working in crystal 8.5 and have an issue with a formula i created causing lines to duplicate. I think it may have to do with my links but i've tried deleting and reversing the links and it doesn't solve the problem

The setup is as follows:

2 tables:
(a)Unit Main
(b)UNIT EXTRA
They are linked on Unit Main_SectionID

The report is setup this way:

Group 1: Unit Main_Number
Group 2: Unit Main_Finish Date
Details: includes Unit Main_Description, Unit Main_Sub Number, Unit Main_Sub Number pt 2


There are 2 formulas that are causing the issue.
These formulas should be pulling the estimated finish dates which are stored in table UNIT EXTRA. Unit Main is linked to UNIT EXTRA on Unit Main_Section ID

The 2 formulas are built as follows:

if {Unit Main_Section ID} = {UNIT EXTRA_Section ID}
then {UNIT EXTRA_FINISH DATE}

The dates that are pulling are correct, however, the report winds up adding however many rows are attached to the UNIT EXTRA record, rather than just leaving one row per record from Unit Main.

I tried creating a subreport with ust the dates in it, but that didn't work. Any suggestions????
 
When you have a one-to-many relationship between 2 tables, you're going to get this result.
It's not a problem or bug, it's just the way things work.

You could try just suppressing (or Hiding) the detail section, and display everything in the Group 2 Footer.

Subreports can be very useful, but add a tremendous amount of overhead, and so should be avoided if possible.
Having said that, I'm curious as to what "didn't work" when you tried to use them.


Bob Suruncle
 
It has been a while since I have comment3ed on Crystal problems but I will say this

I assume you are linked by UnitMain_sectionID and UnitExtra_SectionID.

If this is true then this

if {Unit Main_Section ID} = {UNIT EXTRA_Section ID}

is superfluous since the linking accomplishes that

So you are drawing all recrds in Unit_Extra_FinishDate

You need to add a condition or provide another link between the tables to draw only the record that you want....not knowing what the table structures are I cannot say any more.

Jim Broadbent

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top