Hello
I have the following tables joined on a one (Field4) to many (Field3)
relationship
Table1
Field1 / Field2 / Field3
1 Bob 2
2 Fred 4
3 Paul 2
4 John 3
(AutoNum)
Table2
Field4 / Field5
1 Doctor
2 Dentist
3 Lawyer
4 Teacher
(AutoNum)
The following SQL will output :
SELECT Table1.Field1, Table1.Field2, Table1.Field3, Table2.Field4,
Table2.Field5
FROM Table2 INNER JOIN Table1 ON Table2.Field4 = Table1.Field3;
Field1 / Field 2 / Field3 / Field4 /
Field5
1 Bob 2 2
Dentist
3 Paul 2 2
Dentist
2 Fred 4 4
Teacher
4 John 3 3
Lawyer
How can I write an SQL so that only one record with Dentist (in Field5) is
output
with either Bob or Paul but not both?
Example:
Field1 / Field 2 / Field3 / Field4 /
Field5
1 Bob 2 2
Dentist
2 Fred 4 4
Teacher
4 John 3 3
Lawyer
I am using Access 2000
Thanks
G Gerard