Delete anything with # symbol in field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table where I want to delete and items that has ## in the Brand
name. Example would be ##VISTA. If is set up a Delete query with Like
"*##*" in the criteria field, it deletes anything with a number in
the Brand name, not anything with ## in the name. Assume Access see the # as
any number. Is there way for it to look at # as a text and not as any
number?
 
Supe said:
I have a table where I want to delete and items that has ## in the Brand
name. Example would be ##VISTA. If is set up a Delete query with Like
"*##*" in the criteria field, it deletes anything with a number in
the Brand name, not anything with ## in the name. Assume Access see the # as
any number. Is there way for it to look at # as a text and not as any
number?

LIKE "*[#][#]*"

James A. Fortune
(e-mail address removed)
 
Great. Thanks!

James A. Fortune said:
Supe said:
I have a table where I want to delete and items that has ## in the Brand
name. Example would be ##VISTA. If is set up a Delete query with Like
"*##*" in the criteria field, it deletes anything with a number in
the Brand name, not anything with ## in the name. Assume Access see the # as
any number. Is there way for it to look at # as a text and not as any
number?

LIKE "*[#][#]*"

James A. Fortune
(e-mail address removed)
 
I have a table where I want to delete and items that has ## in the Brand
name. Example would be ##VISTA. If is set up a Delete query with Like
"*##*" in the criteria field, it deletes anything with a number in
the Brand name, not anything with ## in the name. Assume Access see the # as
any number. Is there way for it to look at # as a text and not as any
number?

Yes; you can override the interpretation of a wildcard character by enclosing
it in square brackets. A criterion of

LIKE "[#][#]*"

will return only records with two literal octothorpes at the beginning of the
field.

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