M
motaay
Guest
hi
i am tryin to cretae an SQL query in Access which will show me a list of members who have been an officer of at least 3 committes OR events.
The code that i have at the moment is as follows
SELECT DISTINCT tblMember.FirstName, tblMember.Surname
FROM tblMember, [SELECT COUNT(tblEventOfficer.MemberID) AS X, tblEventOfficer.MemberID
FROM tblEventOfficer
GROUP BY tblEventOfficer.MemberID]. AS TEMP1, [SELECT COUNT(tblComOfficer.MemberID) AS Y, tblComOfficer.MemberID
FROM tblComOfficer
GROUP BY tblComOfficer.MemberID]. AS TEMP2
WHERE (X>=3 and tblMember.MemberID=tblEventOfficer.MemberID) OR (Y>=3 and tblMember.MemberID=tblComOfficer.MemberID);
However, this code will only pick up when a member is either an officer of 3 or more committees or 3 or more events. i.e. if a member is an officer of 1 committee and 2 events this is not picked up in the query as it should do
Please could anyone help???
Thanks
i am tryin to cretae an SQL query in Access which will show me a list of members who have been an officer of at least 3 committes OR events.
The code that i have at the moment is as follows
SELECT DISTINCT tblMember.FirstName, tblMember.Surname
FROM tblMember, [SELECT COUNT(tblEventOfficer.MemberID) AS X, tblEventOfficer.MemberID
FROM tblEventOfficer
GROUP BY tblEventOfficer.MemberID]. AS TEMP1, [SELECT COUNT(tblComOfficer.MemberID) AS Y, tblComOfficer.MemberID
FROM tblComOfficer
GROUP BY tblComOfficer.MemberID]. AS TEMP2
WHERE (X>=3 and tblMember.MemberID=tblEventOfficer.MemberID) OR (Y>=3 and tblMember.MemberID=tblComOfficer.MemberID);
However, this code will only pick up when a member is either an officer of 3 or more committees or 3 or more events. i.e. if a member is an officer of 1 committee and 2 events this is not picked up in the query as it should do
Please could anyone help???
Thanks