Here is a solution.
Access 2.0 does not support OUTERJOIN yet, so I jury-rigged an
outer join via a UNION, two LEFT JOINS, and a JOIN.
First, I put your data into two tables:
temperature(id, temp)
ph(id, pH)
notation is:
(, , ...).
Using these schemas, I put your data in, giving
temperature:
id temp
100001 26.0
278128 27.0
100003 24.5
314159 29.0
ph:
id pH
100001 7.4
100004 7.7
100003 7.6
314159 7.5
For purposes of this example, I used text fields everywhere
with no indexes or primary keys. For efficiency, you would want
to index on id and use numeric fields. Everything would still
work as below with no modifications.
The following queries provide a solution. You can cut and
paste these directly into Access defining new queries having the
names and query definitions exactly as shown. For each query,
create a new blank query, containing no tables. Go into the
SQL Window, where you will see "SELECT DISTINCTROW;", which you
should replace by the from below. Then save the
query as from below.
Notation below is:
:
qyUNIONid:
SELECT id FROM temperature
UNION
SELECT id FROM ph;
qyUNIONid_LJOIN_ph:
SELECT qyUNIONid.id, ph.pH
FROM qyUNIONid LEFT JOIN ph
ON qyUNIONid.id = ph.id;
qyUNIONid_LJOIN_temperature:
SELECT qyUNIONid.id, temperature.temp
FROM qyUNIONid LEFT JOIN temperature
ON qyUNIONid.id = temperature.id;
qyOUTERJOINexample:
SELECT qyUNIONid_LJOIN_temperature.id, temp, pH
FROM qyUNIONid_LJOIN_temperature INNER JOIN qyUNIONid_LJOIN_ph
ON qyUNIONid_LJOIN_temperature.id = qyUNIONid_LJOIN_ph.id;
Open qyOUTERJOINexample and you'll see:
id temp pH
100001 26.0 7.4
100003 24.5 7.6
100004 7.7
278128 27.0
314159 29.0 7.5
Dennis G. Allard
Ocean Park Software
tel. (usa) 310.399.4740
internet: allard@oceanpark.com