Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Queries

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 07-01-2009, 09:55 AM
Liv Liv is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Jul 2009
Posts: 1
Liv is on a distinguished road
Exclamation Multiple Unrelated Tables w/Similar Field in Single Query

I am having a problem as to how to approch this. I have 8 tables with different structures serving different purposes. Each table has a field named "Region". I need to track counts and sums for each table in a single report broken out by "Region". My current (tedious) workaround is creating a query for each region using the DCount and DSum function specifying the region there. Each query is a one line item which in theory I would like to have recorded in a single query.

What I'm working with...

Query 1
Region: "SCAL"
A Count: DCount(from tblA where "Region" equals "SCAL")
B Count: DCount(from tblB where "Region" equals "SCAL")...
A Sum: DSum(from tblA where "Region" equals "SCAL")
B Sum: DSum(from tblB where "Region" equals "SCAL")...
returns:
Region***A Count***B Count***A Sum***B Sum
SCAL****68*******191******32351***9451

Query 2
Region: "NCAL"
A Count: DCount(from tblA where "Region" equals "NCAL")
B Count: DCount(from tblB where "Region" equals "NCAL")...
A Sum: DSum(from tblA where "Region" equals "NCAL")
B Sum: DSum(from tblB where "Region" equals "NCAL")...
returns:
Region***A Count***B Count***A Sum***B Sum
NCAL****77*******132******41258***7942

What i would like returned...

Region***A Count***B Count***A Sum***B Sum
SCAL****68*******191******32351***9451
NCAL****77*******132******41258***7942

Please help on how to approach this. Thank you in advance.
Reply With Quote
  #2  
Old 07-07-2009, 11:00 AM
pdouglas pdouglas is offline Windows XP Access 2002 (version 10.0)
Novice
 
Join Date: Jun 2009
Posts: 12
pdouglas is on a distinguished road
Default

Look at doing a "Union" query to bring things together. This will let you merge things together from several queries into one.
You'll have to type it in using the SQL window of Query Designer.
Look up "Union Query" in the Access Help. The Examples & Union Operation pages should help you get started.
Reply With Quote
Reply

Bookmarks

Tags
domain, functions, query, unrelated tables

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Table related to multiple tables by single ID MrTumnus Access 1 11-17-2009 11:05 AM
Show two tables in single table access Forms 8 06-11-2009 09:57 AM
Help reqd with Count of Similar Vals AnthonyT Access 1 05-18-2009 10:15 AM
using COUNT for multiple tables kwalt Queries 0 02-17-2009 12:06 PM
Once query to lookup information in multiple tables Yanagowa Queries 1 07-06-2007 06:27 AM


All times are GMT -8. The time now is 02:59 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.