QUERY

G

gambler

I have a list of names under one of my query fields. CLM,M05, M10, M20 AND MSW.
I only want to look at the M field. I put *M* in my criteria and I get both
M and MSW. Is there anything I can put in my criteria so I would only see the
M and any number associated with it but not see MSW?
Thanks for any help.
Ed
 
M

[MVP] S.Clark

Correction... last on would only exclude the "CLM"

WHERE [fieldname] LIKE "M##' would exclude CLM and MSW.
 
G

gambler

Sure appreciate the help>
Thanks
ed

[MVP] S.Clark said:
Correction... last on would only exclude the "CLM"

WHERE [fieldname] LIKE "M##' would exclude CLM and MSW.

gambler said:
I have a list of names under one of my query fields. CLM,M05, M10, M20 AND
MSW.
I only want to look at the M field. I put *M* in my criteria and I get
both
M and MSW. Is there anything I can put in my criteria so I would only see
the
M and any number associated with it but not see MSW?
Thanks for any help.
Ed
 
J

John Vinson

I have a list of names under one of my query fields. CLM,M05, M10, M20 AND MSW.
I only want to look at the M field. I put *M* in my criteria and I get both
M and MSW. Is there anything I can put in my criteria so I would only see the
M and any number associated with it but not see MSW?
Thanks for any help.
Ed

You're paying the penalty for storing two (or more?) "fields" in one
field. In any relational database, fields should be "atomic" - not
divisible into smaller entities.

As far as Access is concerned, "CLM", "M10", and "MSW" are all
three-character strings containing the letter M. As far as I'm
concerned, that's just what they are too! And that's what your query
is searching for - a field containing the letter M anywhere within it.

To find only those records containing the letter M followed by two
numeric digits use a criterion of

LIKE "M##"

However, your data storage should really be reconsidered!

John W. Vinson[MVP]
 
G

gambler

Thanks John

John Vinson said:
You're paying the penalty for storing two (or more?) "fields" in one
field. In any relational database, fields should be "atomic" - not
divisible into smaller entities.

As far as Access is concerned, "CLM", "M10", and "MSW" are all
three-character strings containing the letter M. As far as I'm
concerned, that's just what they are too! And that's what your query
is searching for - a field containing the letter M anywhere within it.

To find only those records containing the letter M followed by two
numeric digits use a criterion of

LIKE "M##"

However, your data storage should really be reconsidered!

John W. Vinson[MVP]
 
Top