compare records?

qwkslvr1999

Registered User.
Local time
Today, 14:15
Joined
Jan 21, 2002
Messages
42
I have a table that looks like this:

SID Field2
1 1
1 1
1 2
2 1
2 1
3 2
3 3
3 1
4 1
5 2
5 2

My problem is, I want to get the SID if and only if its value in all occurences is 1, regardless of how many times it appears in the table. So, for my sample table, the result SIDs should be, 2 and 4.

I hope somebody can help me with this one. Thanks!
 
How about creating a summary query to find the min and max of Field2 , grouped by SID, and then a separate select query based on yourtable and above query with a criterion of min=1 AND max=1
 
I never thought of that! I tried it and it absolutely worked! Thank you very much!
 

Users who are viewing this thread

Back
Top Bottom