Using Wildcards in a Like Criteria

B

Brandon

Hello all,

I was just wondering how I could use the * wildcard in a
Like statement. I'm trying to use a field from a form as
part of the criteria, but I want astericks on either side
of the variable. When I put these in though, Access sees
it as a full string and it does not work. Here is the
criteria I'm trying to write.

Like * [Forms].[frmDieSearch].[Description] *

When I try this statement though, Access puts quotes
around the entire statement and that treats it as a whole
string. Not what I'm looking for. Is there some other
punctuation that I should be using in this?

Any feedback on this would be great. Thanks in advance.

Am using Access 2000.

Brandon
 
M

MDW

-----Original Message-----
Hello all,

I was just wondering how I could use the * wildcard in a
Like statement. I'm trying to use a field from a form as
part of the criteria, but I want astericks on either side
of the variable. When I put these in though, Access sees
it as a full string and it does not work. Here is the
criteria I'm trying to write.

Like * [Forms].[frmDieSearch].[Description] *

When I try this statement though, Access puts quotes
around the entire statement and that treats it as a whole
string. Not what I'm looking for. Is there some other
punctuation that I should be using in this?

Any feedback on this would be great. Thanks in advance.

Am using Access 2000.

Brandon


.

Try this:

strSQL = "SELECT........ WHERE myColum LIKE *" & [Forms].
[frmDieSearch].[Description] & "*"
 

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

Top