View Full Version : Query criteria returning odd results


LLB
05-29-2009, 07:52 AM
In my query I want to filter a field to exclude all records that start with "MTC" so I used the Not Like "MTC*" in my criteria. In my list of 100 records I know there are only 6 that meet this criteria but when I run it my results only have 56 records. (The other 38 went to Neverland)

If I reverse the criteria and put in Like "MTC*" I only get the 6 records I know are there.

Am I missing something for the "NOT" opperator? I'm perplexed...

I tried to search an answer but no luck....

Thank you... Lori

Access_guy49
05-29-2009, 08:05 AM
Do you have other tables in your query?
If you take out the condition completely do you get all 100 records in your query results?

pbaldy
05-29-2009, 08:05 AM
Do the other 38 have anything in that field? I don't think Null records would be returned by the Not Like criteria.

LLB
05-29-2009, 08:56 AM
THAT IT!!! ... it's pulling the Null records too.... but I need those so I changed the criteria to Not Like "MTC*" or Is Null and it works.

Thank you.

pbaldy
05-29-2009, 10:14 AM
No problem, and that's the solution I would have suggested, so good work!