Rick Hurst Web Developer in Bristol, UK

Menu

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.

archived comments

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

amin b nagpure 2007-05-22 08:15:56

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

Rick 2007-05-22 08:34:19