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

Combining tables

Status
Not open for further replies.

hwkyetkd11

Technical User
Jan 26, 2006
6
US
Okay here is my SQL
SELECT [A - Top Hng S Thickness 1 ---- QC].Date, [A - Top Hng S Thickness 1 ---- QC].Time, [A - Top Hng S Thickness 1 ---- QC].[Sample 1], [B - Btm Hng S Thickness 1 ---- QC].[Sample 1], [C - Top Width 1 ---- QC].[Sample 1], [D - Btm Width 1 ---- QC].[Sample 1], [E - Btm Hdl S Thickness 1 ---- QC].[Sample 1], [F - Top Hdl S Thickness 1 ---- QC].[Sample 1], [G - Height 1 ---- QC].[Sample 1]
FROM [A - Top Hng S Thickness 1 ---- QC], [B - Btm Hng S Thickness 1 ---- QC], [C - Top Width 1 ---- QC], [D - Btm Width 1 ---- QC], [E - Btm Hdl S Thickness 1 ---- QC], [F - Top Hdl S Thickness 1 ---- QC], [G - Height 1 ---- QC]
ORDER BY [A - Top Hng S Thickness 1 ---- QC].Date DESC , [A - Top Hng S Thickness 1 ---- QC].Time DESC;

I am trying to combine data from 7 different tables into one showing all the measurements at once for each object. The data is entered electronically using a foot pedal to send the data to the computer. Any help would be great!
 
You need to have some joins between the tables, this sql will produce a "cartesian product", which is every combination of values from all 7 tables. are there common fields across these tables that will allow you to link them?

It looks like Sample1 might be. It is hard to know for sure without being familiar with your data.
 
They all have teh same date and time stamp that should connect them. The sample 1 value is different for each currently existing table. Sample 1 is the data it reads in.
 
Trying linking the tables on those 2 fields (date and time), and see if you get what you are looking for.
 
You must have gotten about a million records when you ran your original sql, right?
 
Sorry guys I havent used access a whole lot and just got thrown into this project. With myc urrent SQL I get all the headers I need for my table, how do I link the data and make a table with all the needed information. There may eb an easier way of doing this, I am all ears!
 
I suspect that what you really want is just to append all of the data to a single table with an added field identifying the object.

What is the actual structure of each existing table?
 
On your database window, click on the query tab, hit the New button, choose Design View. In the Add Table window select your tables and hit the Add button. Then in the query design window click on and a drag a field from one table and drop it on the corresponding field in the table you are linking to.

You will need to join on both of those fields in all of your table joins. When you are done you should see two black lines connecting from table to table.

Then drag the fields you need to display from your tables down into the field grid.
 
after I connect the fields how do I get them into a table? The format for each of the 7 tables now is date, time, and sample 1. I want to link them by date and time showing all the sample 1 fields on one table. I just linked them by date and time so I have a bunch of black lines running all over. Now how do I get them into a table?
 
I believe I figured it out, thanks for the help. Knew access two years ago but havent looked it since so been lots of fun
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top