using LIKE in MS ACCESS queries

I was getting bizarre results the other day when using LIKE in an ACCESS query - it turns out then when creating a query in SQL view inside Access you need to use * as a wildcard, but from within ASP you use %.

for example:-

SELECT foo FROM Bar WHERE foo LIKE ‘*Bar*’ <– within Access

SELECT foo FROM Bar WHERE foo LIKE ‘%Bar%’ <– from within ASP

returns the same dataset.

2 Responses to “using LIKE in MS ACCESS queries”

  1. amin b nagpure Says:

    iam also getting the same error, do you have any final good solution for this, iam searching google for the solution found your page

  2. Rick Says:

    well what I have written above is the solution to the problem I was having - use * within Access and % within ASP

Leave a Reply