mgonzales
12-07-2009, 08:23 AM
What is the big difference between the "and" and the "or" statements in when using them as a parameter in an Acces query?
I'm using it to filter out data that I don't need, so I am using "Not Like --- and Not Like" i am also trying "Not like --- or Not Like" They are both pulling data, but my file is like 35k files,so it is hard to determine what is going on. The "and" statements pull 14k and the "or" statements pull 16k.
Thanks
KenHigg
12-07-2009, 08:27 AM
The not like or's kinda cancel each other out :)
mgonzales
12-07-2009, 08:32 AM
Thank you Higg,
so what your saying is..the "or" statements would still pull some of the info that I dont want? So then the "and not like" statements would be the way to go?
Thanks
The not like or's kinda cancel each other out :)
MSAccessRookie
12-07-2009, 08:37 AM
At the most basic Level, an OR Statement will select records that are TRUE for EITHER of the requirements of the OR Statement, while an AND Statement will only select records that are TRUE for BOTH of the requirements of the AND Statement. Take a look at the table below:
Values A=1 OR B=2 A=1 AND B=2
A B
1 2 Selected Selected
1 1 Selected Not Selected
2 2 Selected Not Selected
mgonzales
12-07-2009, 08:48 AM
I am placing the statement in a single field, not across multiple fields. so if i have what is below, what would I get
Values in a single field: 900*, 774*, 556
Statement: not like 900* and not like 774*
Statement: not like 900* or not like 774*
At the Most basic Level, an OR Statement will select records that are TRUE for EITHER of the requirements of the OR Statement, while an AND Statement will only select records that are TRUE for BOTH of the requirements of the AND Statement. Take a look at the table below:
Values A=1 OR B=2 A=1 AND B=2
A B
1 2 Selected Selected
1 1 Selected Not Selected
2 2 Selected Not Selected
KenHigg
12-07-2009, 08:54 AM
I think your best bet is to post some actual sample data like AccessRookie did and explain in plain english what you're trying to do...
Brianwarnock
12-07-2009, 08:58 AM
Or does not make sense on a single field as it can only have one value at a time.
Brian
MSAccessRookie
12-07-2009, 09:07 AM
I am placing the statement in a single field, not across multiple fields. so if i have what is below, what would I get
Values in a single field: 900*, 774*, 556
Statement: not like 900* and not like 774*
Statement: not like 900* or not like 774*
While the content may not be what you are looking for, the presentation still seems to have some potential. Perhaps the following will make it a little clearer:
Values (Not Like 900) OR (Not Like 774) (Not Like 900) AND (Not Like 774)
100 Selected Selected
456 Selected Selected
774 Selected Not Selected
876 Selected Selected
900 Selected Not Selected
Brianwarnock
12-08-2009, 02:49 AM
Values in a single field: 900*, 774*, 556
Statement: not like 900* and not like 774*
Statement: not like 900* or not like 774*
Given the above is the use of Like necessary, ie are you using wild cards to enable searching on parts of field values? If looking at complete values use Not In(,,,,)
Brian