473,396 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

report with two one-to-many relationships

Hello,

I have three tables: persons, telephone_numbers and email_addresses. They
are connected one-to-many:
- one person has many telephone numbers,
- one person has many email addresses.

I want to create report, which will show persons and for each person will
show his telephone numbers and email addresses. However, when I create a
report based on "select * from persons natural join telephone_numbers
natural join email_addresses", it don't work well. If a person has two
telephone numbers and two email addresses, my report has four rows - a
cartesian product of telephones and emails.

Is there any way to achieve what I want?
Sep 26 '08 #1
3 4989
Create a query using just persons and telephone_numbers (an *outer* join, in
case someone has no phone numbers), and use a subreport to show the email
addresses.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Piotr Sobolewski" <NI********@gazeta.plwrote in message
news:gb**********@inews.gazeta.pl...
Hello,

I have three tables: persons, telephone_numbers and email_addresses. They
are connected one-to-many:
- one person has many telephone numbers,
- one person has many email addresses.

I want to create report, which will show persons and for each person will
show his telephone numbers and email addresses. However, when I create a
report based on "select * from persons natural join telephone_numbers
natural join email_addresses", it don't work well. If a person has two
telephone numbers and two email addresses, my report has four rows - a
cartesian product of telephones and emails.

Is there any way to achieve what I want?
Sep 26 '08 #2
Allen Browne wrote:
Create a query using just persons and telephone_numbers (an *outer* join,
in case someone has no phone numbers), and use a subreport to show the
email addresses.
Great idea, and really works! Actually, I created a report with persons only
and added two subreports: one with telephones, and one with emails.

Thanks a lot!

Sep 26 '08 #3
Excellent.

To extend the idea, you can set the subreport up for (say) 4 columns (File |
Page Setup | Columns, set for "Across then down.") That gives you up to 4
phone numbers side-by-side before it needs a 2nd line on the report.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Piotr Sobolewski" <NI********@gazeta.plwrote in message
news:gb**********@inews.gazeta.pl...
Allen Browne wrote:
>Create a query using just persons and telephone_numbers (an *outer* join,
in case someone has no phone numbers), and use a subreport to show the
email addresses.

Great idea, and really works! Actually, I created a report with persons
only
and added two subreports: one with telephones, and one with emails.

Thanks a lot!
Sep 26 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Yasin | last post by:
Hi I have one reports which shows the Account wise daily transaction during the day.(pl's find below report layout format with column description) May or may not be each account have multiple...
7
by: Nothing | last post by:
I have a report based on a query that is based agaisnt two tables. The report pulls information for 1 customer. The tables may hold multipul customers. I want to email just the ONE report. All...
1
by: Rene | last post by:
I have another post regarding this "attendance" report of mine...this one concerns one of my sub-reports. It loses its alphabetical sorting when inserted in the master report. When run...
0
by: Nip | last post by:
I have created a report that gives me a value from one table and then shows a list of values from another table. When the report is viewed the list of things that shows is looks one after the...
4
by: R. Yang | last post by:
Hello, I created a report containing weight and height for 50 individuals. The field "ID" is included in the report. Is there any way I can report the data for a specific person (say,...
4
by: BizWorld | last post by:
I am getting this error in exporting a crystal report (having two subreports) using C# code. i got the following exception at Export statement. Exception Details:...
0
by: neeraj | last post by:
Hi people's I developed One Windows application with some crystal Report I used my predefined crystal reports files for my application. I just take one crystal report viewer on form and set...
1
by: sudhirarora | last post by:
I have created one VB Data report for which I am using Data Envoirnment. The commandtext of Data envoirnment's command is changed at runtime and the report comes correctly. However when I run the...
1
by: Zulema | last post by:
I have a report that produces summed totals in the dept and section footer part of the report. One of the columns is giving me wrong sum, it is off by 22 cents. I exported the same report into...
1
by: mirandacascade | last post by:
Apologies in advance...I'm sure this is a trivial question... Access 97. Situation is this: 1. VBA code sets the recordsource property of a report object; the recordsource is a querydef which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.