Only show data for dates found in several tables

  • Thread starter Thread starter Jen
  • Start date Start date
J

Jen

Hi,
I have a question...I have 6 tables (Test Value, Calculated Value, PI
Value, Diff Value, Test Uncertainty, Diff Uncertainty). Each of these
has the first paramater named "Time" as the Date/Time for the record
and then 500 other parameters of interest for the table.

I want to query a table, but only return the values that have a
date/time found in all 6 tables. For example, if the "Test Value" and
"Calculated Value" tables have the date/time 10/15/2006 10:00, but the
other's do not, then if I query the "Test Value" table for Parameter 5,
the 10/15/2006 10:00 would need to be skipped.

This is my current query...I don't know what to add to achieve this!
Thanks!

Select Time, Param5 AS [Pressure]
FROM TestValue WHERE ((Time) Between [Start Date] And [End Date])

Jennifer
 
It sounds as if you need to put all six tables in the query and join them on
the Time field
SELECT ...
FROM (((([Test Value] INNER JOIN [Calculated Value]
ON [Test Value].[Time] = [Calculated Value].[Time])
INNER JOIN [Pi Value]
ON [Calculated Value].[Time] = [Pi Value].[Time])
INNER JOIN [Diff Value]
ON [Pi Value].[Time] = [Diff Value].[Time])
INNER JOIN [Test Uncertainty]
ON [Test Uncertainty].[Time] = [Diff Value].[Time])
INNER JOIN [Diff Uncertainty]
ON [Test Uncertainty].[Time] = [Diff Uncertainty].[Time]
WHERE ...
 
Back
Top