Solved

One to many

Posted on 2011-02-15
5
438 Views
Last Modified: 2012-05-11
although this should be basic knowledge of using Crystal Repors I can't figure out how I choose my database links.

I have two tables that I want to link together.
I have the field gl.number in both tables but when I chose to make a report I get the same number of records every time eventhough I chose the fields
incidentsm1.incident.id
incidentsm1.opened.by
incidentsm1.gl.number
operatorm1.name

how do I chose in the Crystal repors menu to make my linke like "One to many"
(One operatorm1.name to many incidentsm1.incident.id)?

 Databaselink
0
Comment
Question by:lkudsk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Author Comment

by:lkudsk
ID: 34897108
Then I search for link relationships in Crystal repors I get this result:

When you link records from one table to another table, the records will typically fall under one of two relationship types: one-to-one or one-to-many.
In this section:
One-to-one relationships
One-to-many relationships

What does "....typically fall under one" means? How do I set what I want - "one to one" or "One to many"?

0
 
LVL 77

Expert Comment

by:peter57r
ID: 34897142
I don't think I understand the problem here.  I think there must be more to it than you have said.

If you run the same report with the same data you should get the same number of records every time.

0
 
LVL 77

Expert Comment

by:peter57r
ID: 34897225
You cannot control the relationship- it is what it is - based on which field is linked to which other field and the properties of those fields.

If you link a unique field in one table to a non-unique field in another then you would expect a one-many relationship; if you link unique field then you would expect a one-one.
Having said that I don't know where CR tells you what relationship has been created, and in terms of creating a report I can't see why it matters.
0
 
LVL 5

Accepted Solution

by:
simonpaul64 earned 250 total points
ID: 34898203
OK - just to cover the basics a one to one relationship between tables means that for each row in tableA there will be a matching row in tableB. Those tables are joined (or linked) by a common key (for example tableA.person_id = tableB.person_id).

A one to many relationship means that for each row in TableA there will be one or more rows (or sometimes none or more rows) in TableB. In that is the case tableB will need all the keys from tableA plus at least one further column as a key.

A simple example of that is an HR system with an employee table (each employee has a unique identifier – say employee_id) and then you want to have the employees give you several postal addresses, (home address, mailing address, summer house – whatever). For the second table (often referred to as a child table. You would have employee_id and address_number (1, 2,3). The address number would be a counter for the employee.

So – if you have a crystal with a query of the employee table and then link the second table for addresses they will have several address rows per employee.

Does that help you understand?
0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 250 total points
ID: 34903396
Since you are linking on the GL.Number field that link controls the relationship.

The fields you choose to select from the resulting recordset do not affect the number of records you get.

If you have 1 - operatorm1.name records that can be relateded to many incidentsm1.incident.id records
then you may need to group by the operatorm1.name field and list the related records in the detail section.

If you have more than 1 record in the operatorm1 table for each name value then you may need to link differently or do they all have the same GL.Number value?

Are you filtering the records in any way?

mlmcc

0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

705 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