Union Query and totals.

G

Guest

I have a Union query set up to pull data from two seperate tables. This works
great.
I have a search feature that then can pull specific info from that union. I
now need it to do a sum of 3 of the fields that the search find. Any ideas?

Ex: Tables are Game 1 and Game 2
fields in each table are formation, play, attempts, and yards.

Union pulls the two table together.

I want to search the union based on formation field...the data is returned
such as..

Formation Play Attempts Yards Ave
Right 14 Veer 3 30
10
Right 38 Sweep 2 20 10

This I can do no problem...can I do something like this.....

Formation Play Attempts Yards Ave
Right 14 Veer 3 30
10
Right 38 Sweep 2 20 10
____________________________________________________
Totals: 5 50
10


Thanks in Advance
Rlittle
 
G

Guest

Hi,

Use the Union query as input to a totals query, as such:

Select Formation, Sum(Attempts) as SumAttempts, Sum(Yards) as SumYards,
Avg(Ave) as Avg
From UnionQuery
Group By Formation

Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top