views:

41

answers:

1

Hi,

I've written this SQL query in MS Access:

SELECT *
FROM Students
WHERE name  like '_a*'

Which produces no results, even though I have names like danny and sara in the Students table. THe '_' wildcard doesn't seem to work.

BTW,

like '*a*' 

does return all names with a in them.

And ideas?

+2  A: 

In Access query builder's dialect of sql, you need ? not _. If you connect to the same mdb backend via odbc you'll need to go back to using the standard wildcards.

See this page for details.

mavnn
For the full explanation, though, @Jeff O's citation is essential: http://stackoverflow.com/questions/719115/microsoft-jet-wildcards-asterisk-or-percentage-sign
David-W-Fenton
Thanks David! (few more characters)
mavnn