microsoft access 2003 help needed!!!!

dupdupdup

New member
Local time
Today, 21:18
Joined
Nov 15, 2010
Messages
2
I have the following problem in microsoft access 2003.
i would like to only query out Grp 2where by it only consists of -1.
I would not like the following grps to appear: Column Y consisting of ( -1 & 0 ) or just ( 0 ).

Column X Column Y
Grp 1 ||| -1
Grp 1 ||| 0
Grp 1 |||-1
Grp 2 |||-1
Grp 2 |||-1
Grp 2 |||-1
Grp 3 ||| 0
Grp 3 ||| 0
Grp 3 ||| 0



Any help would be much appreciated!=)
 
Last edited:
In query criteria put:
First criteria "Grp 2" and second criteri -1
 
Hi MStef, thank you for your reply, but i will have multiple grps and i would like to filter out grps that has only -1.
 
The following query should work (substitute highlighted text with actual table/field names):
Code:
SELECT T1.*
FROM [B][I][COLOR="Red"]MyTable[/COLOR][/I][/B] T1
WHERE NOT EXISTS (
  SELECT T2.*
  FROM [B][I][COLOR="red"]MyTable[/COLOR][/I][/B] T2
  WHERE T2.[[B][I][COLOR="red"]Column X[/COLOR][/I][/B]] = T1.[[B][I][COLOR="red"]Column X[/COLOR][/I][/B]]
  AND T2.[[B][I][COLOR="red"]Column Y[/COLOR][/I][/B]] = 0);
 

Users who are viewing this thread

Back
Top Bottom