Return to Databases

  • Thread starter Thread starter Miles
  • Start date Start date
M

Miles

Elementary question I'm sure. I have made a query from two tables. The fields
selected from the first is Site ID, and Sample No. Maybe 20 samples per site.
Tests were done on these samples and the results are in the second table. I
chose one field's results but get every result reported for every sample
where there should be only one. As I said, a database returnee but v
frustrating.
 
Miles,

In order to get the results associated with a particular sample, you need to
JOIN the two tables. I assume that the 2nd table also conatains a Sample No
field, if not, you have a problem. If so, here is how to modify your query.

1. Add both tables to the query grid
2. Click (and hold) on the Sample # field in table 1, and drag across to
the Sample # field in table 2. Then release your mouse button. This should
result in a line between the two tables.
3. Add the appropriate fields from each table to the query

When you are done, you can look at the SQL view and it should look something
like:

SELECT Table1.*, Table2.*
FROM Table1
INNER JOIN Table2
ON Table1.SampleNo = Table2.SampleNo
 
Back
Top