1

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?

Meir
  • 12,285
  • 19
  • 58
  • 70
  • 1
    I would look at this related article: http://stackoverflow.com/questions/719115/microsoft-jet-wildcards-asterisk-or-percentage-sign – JeffO Aug 23 '10 at 14:27
  • 1
    You're mixing wildcard families -- if you're using * then for single characters, you use ?; if you're using % then for single characters it's _. – David-W-Fenton Aug 23 '10 at 19:56

1 Answers1

2

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
  • 9,101
  • 4
  • 34
  • 52