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

query multiple tables

Status
Not open for further replies.

kmayo503

MIS
Jun 21, 2003
70
US
i have several tables setup for the same data for multiple months. i need to run a report on this information. i have tried to setup a query, but it won't let me divide it just by the salesrep it wants to take it all by the individual tables. i need the totals for all of the tables combined. is there any easier way?
 
Create a union query for all the related tables, then query against that.

****************************
When the human body encounters disease it raises its temperature making it uncomfortable not only for the body but also for the disease. So it global warming the Earth's way of saying we are not wanted?

Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
i know how to get there but i am not sure what to pu. i have several tables that are named the month they cover. i need totals and percents for sold, cnx, altcnx, pending, distributed. any help would be great
 
I'd append all the data into one master table (run a make-table from one of the tables to get the format, then run appends for the rest of the tables). That would help you enormously.

Kevin
 
i would do that, but i have to track each individual table on a weekly basis and still run reports based on that individual month. when i combinded the tables before its more complicated than my managment wants to look at. i have to be able to call on one month at random if they need it. believe me putting it in one table would be oh so much easier
 
Why not store the month in the master table? For example you run the make-table, then go into that table and add a column called "TheMonth" and then when you append the data in you specifically append what month number it should be (ie for the July table put a 7). That way you could always get back to what month table the data came from. Just to add to that I'd store the year too...either in another new field or the same. Hope that helps...let me know if I'm way off.

Kevin
 
GoDawgs is right....if all the tables are the same format, just different months, simply create a master table that include the month field and append all data there. Then use this as the storage for all data and query off it, using the month as a criteria.

****************************
When the human body encounters disease it raises its temperature making it uncomfortable not only for the body but also for the disease. So it global warming the Earth's way of saying we are not wanted?

Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
when i tried to combine months i run into conflicts because i have to be able to run a mail merge of just that month and i have record numbers (they aren't the primary key) but i have to have similar numbers becasue that is how we keep track of them. so that won't work. any other thoughts?
 
You have to get the data together somehow...either with our suggestion or using the union query idea. I still think you should combine into one table...you can mail merge based on the Month column that you created and you can keep the record numbers that you currently have and just add an autonumber to the new table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top