Filtering Data From a Table

P

pm

In Query Design, I'm trying to eliminate all termed people (TRM) in a certain
field. I've entered LIKE "TRM" in the criteria. When I open the query, it
still includes the TRM people. What am I doing wrong?

Thanks for any response!
 
B

Beetle

In Query Design, I'm trying to eliminate all termed people (TRM) in a certain
field. I've entered LIKE "TRM" in the criteria. When I open the query, it
still includes the TRM people. What am I doing wrong?

Thanks for any response!

If you want to eliminate them use <> for not equal to

HTH
 
F

fredg

In Query Design, I'm trying to eliminate all termed people (TRM) in a certain
field. I've entered LIKE "TRM" in the criteria. When I open the query, it
still includes the TRM people. What am I doing wrong?

Thanks for any response!

If you use the Like keyword you need to use a wildcard "*"
Like "TRM*"
will include only values that begin with TRM.

You asked to Not include "TRM" so your criteria would read:
Not Like "TRM*"
 
R

Rob Parker

If the "TRM" string is not the leftmost content of the field, you will need:
Not Like "*TRM*"

HTH,

Rob
 
F

fredg

Thanks - okay I tried Not Like "TRM*" and it still pulls TRM.....???

If the value in the field contains just "TRM" then you don't need a
wild card.
<> "TRM"
Will return all records except those that contain just "TRM" in that
field.


If the letters "TRM" are contained with additional text in that
field, then you must use the Like and wildcard combination.

In Access, using the Jet engine, the wildcard is the "*".

Like "TRM*"
will return all records that begin with "TRM"
Not Like "TRM*"
will return all records that do NOT have "TRM" at the beginning of the
field.

Like "*TRM"
returns all records that end with "TRM".
Not Like "*TRM" will return all records that do NOT have "TRM" at the
end of the field.

Like "*TRM*"
Returns all records the include the letters "TRM" anywhere in the
field.
Not Like "*TRM*" will return all records that do NOT have "TRM"
anywhere in the field.

See Access help on
Wildcard
and
SQL;wildcard;
 
P

pm

Okay, I have tried <>"TRM" and Not Like "TRM" and neither work. Below is a
sample of the field with the records in it. There is nothing before or after
TRM.
Any other suggestions?

APANST
SLS
SLS
TRM
TRM
TRM
TRM
TRM
 
F

fredg

Okay, I have tried <>"TRM" and Not Like "TRM" and neither work. Below is a
sample of the field with the records in it. There is nothing before or after
TRM.
Any other suggestions?

APANST
SLS
SLS
TRM
TRM
TRM
TRM
TRM

Is this field in your table a LookUp field?
If so, then the text that you see is not what is stored in the field.

Go back to the original table that stores the data.
What is the Field Name?
What is the Field's Datatype?
If it is Number (but displays Text), click on the LookUp tab on the
lower panel.
It will say Combo Box.
You are using the infamous LookUp field in the table. What you see is
not what is stored.

Include the LookUp table that contains the Text and ID number in the
query.
Make sure there is a relationship between the existing and LookUp
tables. Drag the LookUp table's Text field onto your grid in place of
the exiting field.. Use this new Text Field to do your criteria on.

Combo Boxes on a form are good.
Combo Boxes in your table are bad.
 
Top