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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Problem with LIKE statement

Status
Not open for further replies.

daimaou

Programmer
Apr 4, 2001
154
PT
Hi. I'm having problems using the LIKE statement on VB...
I need to store on a recordset every records having the ID field begining with a '7'. I'm using ADO connecton to MS Access. OK so I suppose it would be something like this for the Select string:

str = "SELECT * FROM Table1 WHERE ID LIKE '7*'"

I guess this should work right?
But it'll return an empty recordset... I've tryed to make this query on Access and it worked. Am I doing something wrong? Since this should be pretty easy...

Any help is appreciated.
 
oops! My mistake... I should use the '%' wildcard instead of the '*', it's the habit :)
Now it's working.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top