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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query set-up help



 
 
Thread Tools Display Modes
  #1  
Old July 2nd, 2008, 06:58 PM posted to microsoft.public.access.queries
michelle
external usenet poster
 
Posts: 818
Default Query set-up help

I need some help. I have multiple tables that I want to combine. All of the
tables have the exact same setup. Let's say there are 2 fields, ID and
Amount and I have 3 tables (both are more in reality).

**Table 1**
a 8
b 1.965
c 1

**Table 2**
d 1
a 16
c 2

**Table 3**
c 3
e 10567
d 10

etc

I want to create a query so that I get table that looks like this:
a 24
b 1.965
c 6
d 11
e 10567

So I want to combine ID's if they appear in multiple tables, and add
"Amounts" for a specific ID across tables. An ID may or may not be in every
table.

Do I use a union query for this? How does that deal with duplicates and
adding?

I hope this is possible....thanks!
  #2  
Old July 2nd, 2008, 07:10 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Query set-up help

Use two queries - Union All and then Totals queries.
--
KARL DEWEY
Build a little - Test a little


"Michelle" wrote:

I need some help. I have multiple tables that I want to combine. All of the
tables have the exact same setup. Let's say there are 2 fields, ID and
Amount and I have 3 tables (both are more in reality).

**Table 1**
a 8
b 1.965
c 1

**Table 2**
d 1
a 16
c 2

**Table 3**
c 3
e 10567
d 10

etc

I want to create a query so that I get table that looks like this:
a 24
b 1.965
c 6
d 11
e 10567

So I want to combine ID's if they appear in multiple tables, and add
"Amounts" for a specific ID across tables. An ID may or may not be in every
table.

Do I use a union query for this? How does that deal with duplicates and
adding?

I hope this is possible....thanks!

 




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 03:52 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.