Daryl,
Apologies for any mix up here. I have posted this question several times &
not been able to find it afterwards. I posted the latest one from home
yesterday hence the different 'name'.
The Query that works i.e. identifying membership of groups is as follows:-
SELECT [College Details].[Organisation Name], [Contact Details].[First
Name], [Contact Details].Surname, [Contact Details].[Position in
Organisation], [Contact Details].[Member of Partnership Forum], [Contact
Details].[Member of Strategic Partner Group], [Contact Details].[Member of
Partner Marketing Group]
FROM [College Details] INNER JOIN [Contact Details] ON [College
Details].[Ref No] = [Contact Details].[College Ref No]
WHERE ((([Contact Details].[Member of Partnership Forum])=Yes) AND
(([College Details].[Current Partnership Status])="Active Partner" Or
([College Details].[Current Partnership Status])="In process of
termination")) OR ((([Contact Details].[Member of Strategic Partner
Group])=Yes) AND (([College Details].[Current Partnership Status])="Active
Partner" Or ([College Details].[Current Partnership Status])="In process of
termination")) OR ((([Contact Details].[Member of Partner Marketing
Group])=Yes) AND (([College Details].[Current Partnership Status])="Active
Partner" Or ([College Details].[Current Partnership Status])="In process of
termination"))
ORDER BY [College Details].[Organisation Name];
The query that gives all contacts for a college when all I want is the
college name that doesn't have a member in any one (or more) of the groups
is:-
SELECT [College Details].[Organisation Name], [Contact Details].Surname,
[Contact Details].[Member of Partnership Forum], [Contact Details].[Member of
Strategic Partner Group], [Contact Details].[Member of Partner Marketing
Group]
FROM [College Details] INNER JOIN [Contact Details] ON [College
Details].[Ref No] = [Contact Details].[College Ref No]
GROUP BY [College Details].[Organisation Name], [Contact Details].Surname,
[Contact Details].[Member of Partnership Forum], [Contact Details].[Member of
Strategic Partner Group], [Contact Details].[Member of Partner Marketing
Group], [College Details].[Current Partnership Status]
HAVING ((([Contact Details].[Member of Partnership Forum])=No) AND
(([College Details].[Current Partnership Status])="Active Partner" Or
([College Details].[Current Partnership Status])="In process of
termination")) OR ((([Contact Details].[Member of Strategic Partner
Group])=No) AND (([College Details].[Current Partnership Status])="Active
Partner" Or ([College Details].[Current Partnership Status])="In process of
termination")) OR ((([Contact Details].[Member of Partner Marketing
Group])=No) AND (([College Details].[Current Partnership Status])="Active
Partner" Or ([College Details].[Current Partnership Status])="In process of
termination"))
ORDER BY [College Details].[Organisation Name];
Look forward to hearing from you now I know where to look & apologies again
for anyone seeing my query & wondering why I hadn't acknowledged them
Daryl S said:
Pillinger -
You should be able to do this with a query using a outer join on the College
table.
If you post your current query (the one that is missing the colleges without
representation on any groups), then we can help you adjust that query. Go
to query design and select the SQL View. Copy/paste that into your reply
posting.
--
Daryl S
:
I have a database (Access 2007) that is used for holding data on and
communicating with FE colleges. Obviously (?) each college has a number of
contacts (up to 14) and these are represented in two tables – one for College
Details and one for Contact Details which are linked by a one to many
relationship. Most colleges have one representative on one of 3 groups, but
not all colleges are represented on all groups and some not on any. The
membership of a group is noted by a field in the Contact details. Getting a
query to run to identify membership of groups is OK. But I can’t figure out
how to get a query with a row per COLLEGE that has no representation on
either one or more of the groups. What I get is a duplication of the college
name (as they identify the number of contacts who are not members of a
group). The only way I can figure it is to have a field in the College Table
which mirrors the one in the Contacts Table and by completing one it
automatically completes the ‘mirror’ field in the other table. I don’t want
to enter the same data twice but cannot link the tables.