Re: Using a Like Statement where data can be either numeric or character.
- From: c.santee@xxxxxxxxx
- Date: 27 Dec 2006 15:02:34 -0800
Bob,
I'm sorry to voice did your energies, it seems to now be functioning
properly... I have absolutely no idea what the problem was but I
appreciate you taking a look at the problem. Thank you for your help.
-- CES
Bob Barrows [MVP] wrote:
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"
.
- References:
- Using a Like Statement where data can be either numeric or character.
- From: c . santee
- Re: Using a Like Statement where data can be either numeric or character.
- From: Bob Barrows [MVP]
- Using a Like Statement where data can be either numeric or character.
- Prev by Date: Re: Using a Like Statement where data can be either numeric or character.
- Next by Date: Re: Display ADO Recordset in Access
- Previous by thread: Re: Using a Like Statement where data can be either numeric or character.
- Index(es):
Relevant Pages
|