Need to return Data having Multiple 'NOT' Booleans or Filters (1 Viewer)

shiznaw

Registered User.
Local time
Today, 04:30
Joined
Feb 3, 2016
Messages
18
I need to be able to return a recordset or filter out the line item data having B22, B02, etc. I can't do [NOT LIKE "*B22*" OR NOT LIKE "*B02*"] because of the double FALSE is TRUE Problem. Does anyone have an idea?

_____________________
Field 1
Journal Entry Description
-----------------------------
85 B90 RECLASS CASH
85 B22 PAYMENT (PMT)
85 B22 PAYMENT (PMT)
85 B02 REINSTATEMENT (US)
85 B48 43151123 11/23/15
85 B48 44151109 11/09/15
85 B76 RAC & HFC Cash Reclass
85 B76 MA Cash Recls
 

jdraw

Super Moderator
Staff member
Local time
Today, 07:30
Joined
Jan 23, 2006
Messages
15,364
Are these 3 separate fields?
If so, then look at the In () operator

After reading plog's post:

These are De Morgans Laws in overview:
The rules can be expressed in English as:

The negation of a conjunction is the disjunction of the negations.
The negation of a disjunction is the conjunction of the negations.

or informally as:

"not (A and B)" is the same as "(not A) or (not B)"

also,
"not (A or B)" is the same as "(not A) and (not B)".
 
Last edited:

plog

Banishment Pending
Local time
Today, 06:30
Joined
May 11, 2011
Messages
11,613
I can't do [NOT LIKE "*B22*" OR NOT LIKE "*B02*"] because of the double FALSE is TRUE Problem

Huh? Whats 'double FALSE is TRUE'? I don't think that's a real thing. I think you are using the wrong seperator:


FALSE OR FALSE = FALSE
FALSE AND FALSE = FALSE
TRUE AND TRUE= TRUE
TRUE OR TRUE = TRUE

FALSE OR TRUE = TRUE
FALSE AND TRUE=FALSE

I believe you need to replace your 'ORs' with 'ANDSs'.
 

shiznaw

Registered User.
Local time
Today, 04:30
Joined
Feb 3, 2016
Messages
18
The SQL STatement - [NOT LIKE "*B22*" OR NOT LIKE "*B02*"] returns a Positive for All Items not having B22 (items With B02) AND All Items not having B02 (items With B22). This is what I was referring to. Nevermind, though, JDraw's logical construction helped me resolve it.

Answer below because of JDraw's help:
SELECT [Oracle JE].[JE Line Description]
FROM [Oracle JE]
WHERE ((([Oracle JE].[JE Line Description]) Not Like "*B22*") AND (([Oracle JE].[JE Line Description]) Not Like "*B02*"));​
 

Attachments

  • OR Table.JPG
    OR Table.JPG
    12.6 KB · Views: 90

MarkK

bit cruncher
Local time
Today, 04:30
Joined
Mar 17, 2004
Messages
8,178
. . . or . . .
Code:
NOT ( field like test1 OR field like test2 )
Isn't that equivalent?
 

Users who are viewing this thread

Top Bottom