A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Report from 2 tables



 
 
Thread Tools Display Modes
  #1  
Old May 10th, 2010, 02:42 PM posted to microsoft.public.access.reports
[email protected]
external usenet poster
 
Posts: 60
Default Report from 2 tables

Hi

Just wanted to get some advice before I attempt to make a report that
will use 2 tables as source material.

Basically, my database stores information on a sport.
One table is a list of teams and their historical venues/successes etc
The second table is a list of the teams annual results.

The report I want to make will be a page per team report, that at the
top shows the data from the 'venues' table, so where there are more
than one venue, it would need to 'loop' through the table to show all
venues
As far as the 'successes' (League Championships/cup wins etc) goes, I
wouldn't want that in the loop! (IE only show it once per team.
Below this venue and successes data, I want to show the annual results
from the second table.

This is where I would value this groups advice.
Do I need to link the tables using relationships, and have the second
section as a sub-report of the first?

Many thanks
Neil
  #2  
Old May 10th, 2010, 03:33 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Report from 2 tables

wrote:
Just wanted to get some advice before I attempt to make a report that
will use 2 tables as source material.

Basically, my database stores information on a sport.
One table is a list of teams and their historical venues/successes etc
The second table is a list of the teams annual results.

The report I want to make will be a page per team report, that at the
top shows the data from the 'venues' table, so where there are more
than one venue, it would need to 'loop' through the table to show all
venues
As far as the 'successes' (League Championships/cup wins etc) goes, I
wouldn't want that in the loop! (IE only show it once per team.
Below this venue and successes data, I want to show the annual results
from the second table.

This is where I would value this groups advice.
Do I need to link the tables using relationships, and have the second
section as a sub-report of the first?



First, you need to use the report's Sorting and Grouping
(view menu) to get a group header for the team information.
Then, it sounds like you want the venue data in the detail
section. Use a subreport in the team group footer section
to list the success info in the team group footer section.

--
Marsh
MVP [MS Access]
  #3  
Old May 10th, 2010, 03:51 PM posted to microsoft.public.access.reports
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Report from 2 tables

One table is a list of teams and their historical venues/successes etc
I would suggest separating teams from their historical venues/successes etc.

Team table to only contain information that is not related to dates, games,
tournements, series, etc. If you will keep stats on players of the team then
use another table for players and still another for their records.

Your query would use a left join from team table to their records table.
Using a left join lets you display the team even if they do not have a record
in the joined table.

--
Build a little, test a little.


" wrote:

Hi

Just wanted to get some advice before I attempt to make a report that
will use 2 tables as source material.

Basically, my database stores information on a sport.
One table is a list of teams and their historical venues/successes etc
The second table is a list of the teams annual results.

The report I want to make will be a page per team report, that at the
top shows the data from the 'venues' table, so where there are more
than one venue, it would need to 'loop' through the table to show all
venues
As far as the 'successes' (League Championships/cup wins etc) goes, I
wouldn't want that in the loop! (IE only show it once per team.
Below this venue and successes data, I want to show the annual results
from the second table.

This is where I would value this groups advice.
Do I need to link the tables using relationships, and have the second
section as a sub-report of the first?

Many thanks
Neil
.

  #4  
Old May 10th, 2010, 03:57 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Report from 2 tables

You haven't suggested the relationship between the two tables. If it is one
to many than you can use a query that joins the tables as the record source.
If you have many to many, you need to use a subreport to display one of the
"many" tables. This subreport would be located in a group header or footer
for the common field.

--
Duane Hookom
Microsoft Access MVP


" wrote:

Hi

Just wanted to get some advice before I attempt to make a report that
will use 2 tables as source material.

Basically, my database stores information on a sport.
One table is a list of teams and their historical venues/successes etc
The second table is a list of the teams annual results.

The report I want to make will be a page per team report, that at the
top shows the data from the 'venues' table, so where there are more
than one venue, it would need to 'loop' through the table to show all
venues
As far as the 'successes' (League Championships/cup wins etc) goes, I
wouldn't want that in the loop! (IE only show it once per team.
Below this venue and successes data, I want to show the annual results
from the second table.

This is where I would value this groups advice.
Do I need to link the tables using relationships, and have the second
section as a sub-report of the first?

Many thanks
Neil
.

  #5  
Old May 10th, 2010, 04:24 PM posted to microsoft.public.access.reports
[email protected]
external usenet poster
 
Posts: 60
Default Report from 2 tables

On 10 May, 15:57, Duane Hookom wrote:
You haven't suggested the relationship between the two tables. If it is one
to many than you can use a query that joins the tables as the record source.
If you have many to many, you need to use a subreport to display one of the
"many" tables. This subreport would be located in a group header or footer
for the common field.

--
Duane Hookom
Microsoft Access MVP



" wrote:
Hi


Just wanted to get some advice before I attempt to make a report that
will use 2 tables as source material.


Basically, my database stores information on a sport.
One table is a list of teams and their historical venues/successes etc
The second table is a list of the teams annual results.


The report I want to make will be a page per team report, that at the
top shows the data from the 'venues' table, so where there are more
than one venue, it would need to 'loop' through the table to show all
venues
As far as the 'successes' (League Championships/cup wins etc) goes, I
wouldn't want that in the loop! (IE only show it once per team.
Below this venue and successes data, I want to show the annual results
from the second table.


This is where I would value this groups advice.
Do I need to link the tables using relationships, and have the second
section as a sub-report of the first?


Many thanks
Neil
.- Hide quoted text -


- Show quoted text -


The common field will be the team name, and yes, there are many
occurences in the results table - one per year generally, and as
mentioned, if the team moved venue, then in the first table (venues/
successes), there will also be 'many'

I've a thought to make a 3rd table and split out the trophies bit
(successes) so that the venues is purely stadium/track data

Would the report still work with 3 tables? I presume it's then just
about the relationship with many to many joins?

Neil
  #6  
Old May 10th, 2010, 05:27 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Report from 2 tables

I don't understand your table structures. I don't know if they are normalized
or not. The solutions both Marsh and I have suggested should work for
displaying data in your report.

--
Duane Hookom
Microsoft Access MVP


" wrote:

On 10 May, 15:57, Duane Hookom wrote:
You haven't suggested the relationship between the two tables. If it is one
to many than you can use a query that joins the tables as the record source.
If you have many to many, you need to use a subreport to display one of the
"many" tables. This subreport would be located in a group header or footer
for the common field.

--
Duane Hookom
Microsoft Access MVP



" wrote:
Hi


Just wanted to get some advice before I attempt to make a report that
will use 2 tables as source material.


Basically, my database stores information on a sport.
One table is a list of teams and their historical venues/successes etc
The second table is a list of the teams annual results.


The report I want to make will be a page per team report, that at the
top shows the data from the 'venues' table, so where there are more
than one venue, it would need to 'loop' through the table to show all
venues
As far as the 'successes' (League Championships/cup wins etc) goes, I
wouldn't want that in the loop! (IE only show it once per team.
Below this venue and successes data, I want to show the annual results
from the second table.


This is where I would value this groups advice.
Do I need to link the tables using relationships, and have the second
section as a sub-report of the first?


Many thanks
Neil
.- Hide quoted text -


- Show quoted text -


The common field will be the team name, and yes, there are many
occurences in the results table - one per year generally, and as
mentioned, if the team moved venue, then in the first table (venues/
successes), there will also be 'many'

I've a thought to make a 3rd table and split out the trophies bit
(successes) so that the venues is purely stadium/track data

Would the report still work with 3 tables? I presume it's then just
about the relationship with many to many joins?

Neil
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.