S
Steve
Hi Folks
It's very early on a Sunday morning and I'm still battling after days of
"pratting around" trying to work out what must be an idiotically simple MS
Access problem. I've posted here before (Can't find the original thread) and was
pointed to the problem of Cartesian Products but I've looked at the suggestions
and to be honest (and this hurts me to say) I'm completely lost.
So I'll try and explain exactly what I'm trying to do (excuse the what is
probably excessive detail but I’m trying not to confuse) and if somebody can get
back to be quickly (I need this tomorrow) it would be so very much appreciated.
Firstly and I've tried this on a very simple Table/Query combination and it
works no problem. What I did was to generate and save, two excel worksheets
Worksheet 1 Equip.xls) comprises of 5 records as follows with the first line
being the filed descriptors:
Equip Description
PMP-200 BIG PUMP
PMP-201 ANOTHER BIG PUMP
PMP-202 SMALL PUMP
PMP-203 TINY PUMP
PMP-204 NEW PUMP
Worksheet 2 Tag.xls is as follows
Equip Tag Service
PMP-200 200-FT200 Pump Flow
PMP-200 200-PT-200 Pump Pressure
PMP-201 201-FT201 Pump Flow
PMP-201 201-PT-201 Pump Pressure
PMP-202 202-FT202 Pump Flow
PMP-202 202-PT-202 Pump Pressure
PMP-203 203-FT203 Pump Flow
PMP-203 203-PT-203 Pump Pressure
PMP-205 205-PT-205 Pump Pressure
I then linked these 2 worksheets into an Access (2003) database. With table
names “Equip” and “Tag”.
I then generated a relation ship between the 2 tables using the “Equip” field
from each table. The join properties were No 2 i.e. “Include all records from
“Tag” and only those from “Equip” where the joined fields are equal.
Finally I generated a simple query in Design View in the format (and I hope this
displays OK on Usenet):
Equip Description Tag Service
Tag Equip Tag Tag
I then ran the query and got:
Equip Description Tag Service
BIG PUMP PMP-200 200-FT200 Pump Flow
BIG PUMP PMP-200 200-PT-200 Pump Pressure
ANOTHER BIG PUMP PMP-201 201-FT201 Pump Flow
ANOTHER BIG PUMP PMP-201 201-PT-201 Pump Pressure
SMALL PUMP PMP-202 202-FT202 Pump Flow
SMALL PUMP PMP-202 202-PT-202 Pump Pressure
TINY PUMP PMP-203 203-FT203 Pump Flow
TINY PUMP PMP-203 203-PT-203 Pump Pressure
PMP-205 205-PT-205 Pump Pressure
This is EXACTLY what I expected and wanted i.e. 9 records (all records in the
TAG table) with one field missing in the last record as there was no matching
record in the “Equip" table. There was also (as expected) no reference to the
last record in the “Equip” table as there was no “matching” record in “TAG” for
the field Equip
I do hope that all made sense and that at least some of you have stayed with me.
OK so now I try exactly the same thing with the Real worksheets they both have
more fields and more records with Tag having 963 records and Equip with 370.
There are more instances in both tables where there is no matching field in the
other table but otherwise the philosophy looks the same (well to be honest there
must be a significant difference but I can’t see it) Anyway when I run the query
I get 1693 records with many duplicates included.
So a very simple question WHY and more importanty how do I stop it?
I really do hope that somebody can point me in the right direction cause this
isn’t doing my mental state any good
Thanks (In anticipation)
Steve
It's very early on a Sunday morning and I'm still battling after days of
"pratting around" trying to work out what must be an idiotically simple MS
Access problem. I've posted here before (Can't find the original thread) and was
pointed to the problem of Cartesian Products but I've looked at the suggestions
and to be honest (and this hurts me to say) I'm completely lost.
So I'll try and explain exactly what I'm trying to do (excuse the what is
probably excessive detail but I’m trying not to confuse) and if somebody can get
back to be quickly (I need this tomorrow) it would be so very much appreciated.
Firstly and I've tried this on a very simple Table/Query combination and it
works no problem. What I did was to generate and save, two excel worksheets
Worksheet 1 Equip.xls) comprises of 5 records as follows with the first line
being the filed descriptors:
Equip Description
PMP-200 BIG PUMP
PMP-201 ANOTHER BIG PUMP
PMP-202 SMALL PUMP
PMP-203 TINY PUMP
PMP-204 NEW PUMP
Worksheet 2 Tag.xls is as follows
Equip Tag Service
PMP-200 200-FT200 Pump Flow
PMP-200 200-PT-200 Pump Pressure
PMP-201 201-FT201 Pump Flow
PMP-201 201-PT-201 Pump Pressure
PMP-202 202-FT202 Pump Flow
PMP-202 202-PT-202 Pump Pressure
PMP-203 203-FT203 Pump Flow
PMP-203 203-PT-203 Pump Pressure
PMP-205 205-PT-205 Pump Pressure
I then linked these 2 worksheets into an Access (2003) database. With table
names “Equip” and “Tag”.
I then generated a relation ship between the 2 tables using the “Equip” field
from each table. The join properties were No 2 i.e. “Include all records from
“Tag” and only those from “Equip” where the joined fields are equal.
Finally I generated a simple query in Design View in the format (and I hope this
displays OK on Usenet):
Equip Description Tag Service
Tag Equip Tag Tag
I then ran the query and got:
Equip Description Tag Service
BIG PUMP PMP-200 200-FT200 Pump Flow
BIG PUMP PMP-200 200-PT-200 Pump Pressure
ANOTHER BIG PUMP PMP-201 201-FT201 Pump Flow
ANOTHER BIG PUMP PMP-201 201-PT-201 Pump Pressure
SMALL PUMP PMP-202 202-FT202 Pump Flow
SMALL PUMP PMP-202 202-PT-202 Pump Pressure
TINY PUMP PMP-203 203-FT203 Pump Flow
TINY PUMP PMP-203 203-PT-203 Pump Pressure
PMP-205 205-PT-205 Pump Pressure
This is EXACTLY what I expected and wanted i.e. 9 records (all records in the
TAG table) with one field missing in the last record as there was no matching
record in the “Equip" table. There was also (as expected) no reference to the
last record in the “Equip” table as there was no “matching” record in “TAG” for
the field Equip
I do hope that all made sense and that at least some of you have stayed with me.
OK so now I try exactly the same thing with the Real worksheets they both have
more fields and more records with Tag having 963 records and Equip with 370.
There are more instances in both tables where there is no matching field in the
other table but otherwise the philosophy looks the same (well to be honest there
must be a significant difference but I can’t see it) Anyway when I run the query
I get 1693 records with many duplicates included.
So a very simple question WHY and more importanty how do I stop it?
I really do hope that somebody can point me in the right direction cause this
isn’t doing my mental state any good
Thanks (In anticipation)
Steve