-1

I have an Access user database similar to

UserName |
Award |
DateGiven

We assign various types of awards. Each award assignment would have a separate entry. I need to be able to find which users have been assigned 3 specific awards.

For instance:

We assign award a, b, c, d, e, and f.

john, a, 01/01/14|
bill, b, 02/02/14|
john, c, 01/02/14|
mary, a, 01/01/14|
sue, e, 01/01/14|
john, b, 01/01/14|

I need to be able to show which users have been assigned award a and b and c, so from the above it would only show John.

Ideas?

2 Answers2

4
select username
from your_table
where award in ('a','b','c')
group by username
having count(distinct award) = 3
juergen d
  • 201,996
  • 37
  • 293
  • 362
0
select username
from your_table
where award in ('a','b','c','d','e','f');
Sayan
  • 93
  • 3
  • 9