Re: Using a Like Statement where data can be either numeric or character.
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Wed, 27 Dec 2006 16:50:53 -0500
c.santee@xxxxxxxxx wrote:
All,
I was hoping someone would be of help me figure out how to use a Like
Statement where the field contains characters or numeric values.
The type of characters in the data or search string is irrelevant. Like can
only be used for fields defined as text/character datatype. This datatype
can contain either alpha or numeric characters.
What database are you using?
Can you reproduce this with your database's native query execution tool?
When I use the following strSQL with the variable valueToCheckFor
containing only characters the SQL string executes properly and
returns the correct number of records:
valueToCheckFor = "Text"
strSQL = "SELECT [tmpCLID].[clID] FROM tmpCLID WHERE
((([tmpCLID].[clID]) Like " & Chr(34) & valueToCheckFor & "%" &
Chr(34) & "));"
However when valueToCheckFor = "Text01" even though there are records
that matches this value, my query returns zero records.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
.
- Follow-Ups:
- References:
- Prev by Date: Using a Like Statement where data can be either numeric or character.
- Next by Date: Re: Using a Like Statement where data can be either numeric or character.
- Previous by thread: Using a Like Statement where data can be either numeric or character.
- Next by thread: Re: Using a Like Statement where data can be either numeric or character.
- Index(es):
Relevant Pages
|
|