Multiple common fields between two tables

N

N.F. Harrison

I'm not 100% sure if this should go here or in the queries group, but it is
relationship based so please excuse the multiple posting...

I have an old database, 1 table only, with experimental data. The
experiment involves samples put in buckets mounted on a stick (to simplify
greatly). Each stick was given a unique identifying number. Each row in
the table contains data on one sample from one bucket on one string from one
date. It is now important that the size of the bucket be used in
calculations with the data, so I built a second table with the stick number,
position of bucket (1 through 6) and the bucket size. The stick number and
position are common fields with the original table, I thought I could just
use a query when pulling data from the main table to add in the bucket size
with each line of data. I've tried a number of things, the most promising I
thought was a subquery, where the subquery used the stick and position
values of a line to get the size data from the other table, but all it does
is give me every line from the main table X every line from table 2, with
the subquery column blank. I'm down to adding another column to the already
large main table with the stick and position id's combined, and changing the
other table to just 2 columns. But that is a major addition to a table of
90000 files and growing. Is there a better way? Any help is greatly
appreciated.

N.F. Harrison
 
S

Steve Schapel

N.F. Harrison,

Did you try a query including your original table and the new table,
joined on the stick number and position fields? From your description,
Iimagine this would return the bucket size relating to each of your main
table records.
 
N

N.F. Harrison

Thank you thank you thank you. I feel pretty silly now. I had tried that
before, and it didn't work. After your suggestion, I went back to double
check that the data types were the same. In fact, the data itself was
different, I was referring to sticks just by their number, the old table
lists them as S=280, instead of just 280. Thanks. Sometimes just a
different perspective makes a world of difference.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top