two sets of criteria select query prob

steallan

Registered User.
Local time
Today, 23:54
Joined
Feb 9, 2005
Messages
46
Hi
I have a select query and im running it with Like "*pendant*" in the criteria of one field so i only get the records that have pendant in this field

but i have added another criteria, Not "6077" in another field, so i get records with pendant in field one so long as they dont have 6077 in field two.

I also want to get rid of records with 6074 in field two.

how do you put the criterias in to do this? i had the following:

Field 1 Field 2
Not Like "6077" Like "*pendant*"
Not Like "6074" Like "*pendant*"

but this gives me all the records with pendant in, 6077s and 6074 are still there.

If i get rid of the second Like "*pendant*" all the records appear!!

Help
 
Hi steallan,

Try replacing Not Like to <>

HTH

Taff.
 
Access had autochanged it when i saved, but there is no change to the outcome of the query

It does say dataset not updateable in the bottom left when you change from design view to view what changes the query will do. Anyone know what that means?

thanks
 
criteria

Hi Steallan,

It looks to me like the criteria you entered is telling the query to take records that are like pendant and not like 6077 OR like pendant and not like 6074. That's why its giving all records like pendant.

You may want to put:

<> 6077 and <> 6074 for first field
like "*pendant*" for second field
 
steallan said:
Hi
I have a select query and im running it with Like "*pendant*" in the criteria of one field so i only get the records that have pendant in this field

but i have added another criteria, Not "6077" in another field, so i get records with pendant in field one so long as they dont have 6077 in field two.

I also want to get rid of records with 6074 in field two.

how do you put the criterias in to do this? i had the following:

Field 1 Field 2
Not Like "6077" Like "*pendant*"
Not Like "6074" Like "*pendant*"

but this gives me all the records with pendant in, 6077s and 6074 are still there.

If i get rid of the second Like "*pendant*" all the records appear!!

Help

Field one should be on the same line in the query builder and should be something like:

not like "6077" and not like "6074"

Field two should be on the same line and be something like:

Like "*pendant*"

???
???
 
Thanks everyone that was it, i needed the two "not likes" seperated by and And.


Thanks again
 

Users who are viewing this thread

Back
Top Bottom