Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / February 2008

Tip: Looking for answers? Try searching our database.

Union Query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ftwguy - 15 Feb 2008 02:33 GMT
I am trying to query 5 .mdb files which have their own tables, queries,
reports.  Each DB table covers a product such as snack food, soda, water,
milk, ice cream based on customer purchases.  There are obviously duplicate
customers in each table.  All customers have a unique ID such as DFW123,
FTW123, HOU457 etc.  This ID does appear in all 5 database tables since they
may buy all products.

I need to get a query to provide this for each :
CustomerID, StoreName, Address, City, Zip, Snack Food, Soda, Water, Milk, IC

(the above would be the columns)

CustomerID, StoreName, Address, City, Zip, Snack Food, Soda, Water, Milk, IC
DFW123        My Grocery  4567 S   Dal  75         100        239     156    
65    249
FTW123        Ziggy's         346 N    Ftw 76          239        45      
100   78     133

So basically, each Customer ID would show their total purchases of each
product from 5 different tables.  I thought a Union All Query would work, but
what I end up with is 1 column that sums the numbers rather than list them
out under individual columns as above.
Duane Hookom - 15 Feb 2008 04:00 GMT
Use a union query as the source for  a crosstab query. Set the column heading
to your product values.
Signature

Duane Hookom
Microsoft Access MVP

> I am trying to query 5 .mdb files which have their own tables, queries,
> reports.  Each DB table covers a product such as snack food, soda, water,
[quoted text clipped - 18 lines]
> what I end up with is 1 column that sums the numbers rather than list them
> out under individual columns as above.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.