find if value exist in either of 2 fields (1 Viewer)

yahoo

Registered User.
Local time
Today, 01:58
Joined
Jan 10, 2013
Messages
13
Hey

I need to find all MaintItems which field MIC don't exist in either MIC1 or MIC2. So the only result which I need to see is MaintItem '5100161086' as MIC <> MIC1
Unfortunately I can create query which would approve '5100662734' as well

MaintItem ------MIC------ MIC1 ------ MIC2
5100634036 50000173 50000173
5100662790 50000174 50000174
5100662734 50000145 50000145 50000180

5100662734 50000180 50000145 50000180
5100161086 500001711 50000173

So bottom line I need a query which will display only the row below as MIC doesn't exist in neither MIC1 nore MIC2. Also I will have to deal with much more MICs soon so maybe there is a way to concatenate them and compare, isn't it?
5100161086 500001711 50000173

Attached query is what I got so far, but that displays last 3 rows of table above
 

Attachments

  • bbb.PNG
    bbb.PNG
    19.2 KB · Views: 53
Last edited:

plog

Banishment Pending
Local time
Yesterday, 19:58
Joined
May 11, 2011
Messages
11,646
Long Story: I only have 5 minutes to type this.

Medium Story: You are incorrectly using OR in your WHERE clause when you shoudl use AND

Short story: Move the criteria on MIC2 up a line.
 

yahoo

Registered User.
Local time
Today, 01:58
Joined
Jan 10, 2013
Messages
13
that doesn't work unless I fill MIC2 empty cells with some string
 

plog

Banishment Pending
Local time
Yesterday, 19:58
Joined
May 11, 2011
Messages
11,646
Then try adding:

AND IS Not Null

To both criteria
 

Users who are viewing this thread

Top Bottom