Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using "LIKE" in access sql

Status
Not open for further replies.

gotmilk2

Programmer
Jan 24, 2006
10
US
Whenever I use the 'LIKE' operator no data is return. Am i using it properly? example: Select * from sometable where somefield like 'B%'
 
Hi!

It depends what you are trying to do. If you want to return all records that the field starts with the letter b then you do this:

Like "B*"

the * means that there can be any number of characters after the b the % means that there is only one character after the b.

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
the % means that there is only one character
I disagree.
The % is the STANDARD wild character whereas * is the JetSQL/VBA one.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
The % is the STANDARD wild character whereas * is the JetSQL/VBA one

That is of course correct but he specifically asked about Access SQL so I answered it that way. I hope that this did not confuse the asker.



Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
So the JetSQL "unique character" is ? (not %)
 
Sorry

That is correct, I was getting my wildcards confused. The ? is the single character wildcard not %.

Good call PHV

Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top