frequently ask ? : Computers : Programming : Languages : PHP : Database Backed Sites : Access

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

124 of 141 people (88%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How do I use the LIKE operator with an Access DB thru ODBC
How do I use the LIKE operator with an Access DB thru ODBC

Oct 20th, 2000 19:16
Nathan Reeves, Onno Benschop,


A common problem when doing a like query on an Access DB via ODBC is 
that the '*' wildcard operator doesn't work.  It works fine in Access 
queries but when you connect to a DB via ODBC it doesn't.
Works out, that the wildcard operator through ODBC is '%' so to find 
all employees with the first letter of their firstname being 'N' you 
could use the following SQL:
SELECT firstname, lastname FROM tblEmployee WHERE (lastname Like 'N%');
Took me a while to work this one out.
Hope it helps someone.
Cheers
Nathan