Exclude items in a query

F

Fev

Hi
I would appreciate some help with the following query: I have a table
called tblFrequentInteraction that lists all staff ID's (from
tblStaff) and the StaffID's with whom they frequently interact. I now
want to create query for a combo box on a form that will exclude the
staff ID's with whom they frequently interact, to choose the next
level of interaction - InFrequent interaction. The unmatched query
wizard is not giving me what I need, as it lists staff that IDStaff
1010 frequently interact with, becuase other staff members have
selected them. I need to modify this query so that staff are excluded
totally from the list if staff 1010 listed them as a frequent
interaction.

My SQL:
SELECT tblFrequentInteraction.IDFrequent, tblStaff.FirstName,
tblStaff.LastName
FROM tblStaff INNER JOIN tblFrequentInteraction ON tblStaff.IDStaff =
tblFrequentInteraction.IDFrequent
WHERE (((tblFrequentInteraction.IDStaff)<>1010))
GROUP BY tblFrequentInteraction.IDFrequent, tblStaff.FirstName,
tblStaff.LastName;

Thanks
Fev
 
F

Fev

Hi
I would appreciate some help with the following query: I have a table
called tblFrequentInteraction that lists all staff ID's (from
tblStaff) and the StaffID's with whom they frequently interact. I now
want to create query for a combo box on a form that will exclude the
staff ID's with whom they frequently interact, to choose the next
level of interaction - InFrequent interaction.  The unmatched query
wizard is not giving me what I need, as it lists staff that IDStaff
1010 frequently interact with, becuase other staff members have
selected them.  I need to modify this query so that staff are excluded
totally from the list if staff 1010 listed them as a frequent
interaction.

My SQL:
SELECT tblFrequentInteraction.IDFrequent, tblStaff.FirstName,
tblStaff.LastName
FROM tblStaff INNER JOIN tblFrequentInteraction ON tblStaff.IDStaff =
tblFrequentInteraction.IDFrequent
WHERE (((tblFrequentInteraction.IDStaff)<>1010))
GROUP BY tblFrequentInteraction.IDFrequent, tblStaff.FirstName,
tblStaff.LastName;

Thanks
Fev

I was able to solve this myself - However I find these groups
invaluable for the incredible responses and resources they make
available
Thanks
 
J

John W. Vinson

I was able to solve this myself - However I find these groups
invaluable for the incredible responses and resources they make
available
Thanks

Would you be willing to post the SQL of your solution so future readers can
benefit?

I'd use a NOT EXISTS clause but there are several possible solutions.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top