Searching for ", " in a query

  • Thread starter Thread starter Brian Smith
  • Start date Start date
B

Brian Smith

This is driving me nuts.

I have a query where I want to extract records in which a given field
contains a comma followed by a space. I thought *, * would work but I keep
getting an error about invalid comma usage. I've tried putting the comma in
square brackets but that doesn't work either. What's the proper syntax to
find ", " within a text string?

Thanks.

Brian
 
This is driving me nuts.

I have a query where I want to extract records in which a given field
contains a comma followed by a space. I thought *, * would work but I keep
getting an error about invalid comma usage. I've tried putting the comma in
square brackets but that doesn't work either. What's the proper syntax to
find ", " within a text string?

Thanks.

Brian

Two things: you need the LIKE operator for wildcards such as * to be
interpreted as wildcards; and you need to delimit any criteria used in a TEXT
field search (wildcards or not) with quotemarks, either ' or ". Try a
criterion of

LIKE "*, *"


John W. Vinson [MVP]
 
John W. Vinson said:
Two things: you need the LIKE operator for wildcards such as * to be
interpreted as wildcards; and you need to delimit any criteria used in a
TEXT
field search (wildcards or not) with quotemarks, either ' or ". Try a
criterion of

LIKE "*, *"


John W. Vinson [MVP]

Thanks. Trust me, I looked through the online help and nowhere do they seem
to discuss this situation. By the way, why is it if you are using the query
grid it will put in Like and the quotation marks for you if you enter say
*str* but not in the case I mentioned? What is so special about the comma
considering it's not a wildcard character?

Brian
 
Thanks. Trust me, I looked through the online help and nowhere do they seem
to discuss this situation. By the way, why is it if you are using the query
grid it will put in Like and the quotation marks for you if you enter say
*str* but not in the case I mentioned? What is so special about the comma
considering it's not a wildcard character?

I have no idea! I'm so used to automatically typing in the quotemarks (and
LIKE if need be) that I've never noticed this "helpfulness".

I presume that the comma is seen as a delimiter separating two "somethings" so
it overrides the automatic editing.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top