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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Totals for Union Query?

Status
Not open for further replies.

Preetham16

IS-IT--Management
Dec 28, 2006
32
DE
Hi gurus,
How do I create totals for specific columns in a Union Query? Some code would be of Great appreciated
 
I would wrap another query round your UNION query, doing it that way you can pretty much do whatever you want with the results.

Hope this helps

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
I am trying to do the same thing .. but could not succeed so far could you please tell me the step how I can do that ..?
 
Basically, something like this:
Code:
SELECT Field1, Field2, Sum(Field3)
From
(SELECT Field1, Field2, Field3...
UNION
SELECT Field1, Field2, Field3...)
GROUP BY Field1, Field2
You do a select query using the UNION you made as the from criteria.

Hope that helps.

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top