substring search in access

  • Thread starter Thread starter JavaGuru
  • Start date Start date
J

JavaGuru

Hey,
I want to do a substring search in a database, and access complains about
the query being too complex, can somebody help ? this is the code :

SELECT *
FROM MOVIES
WHERE InStr(MOVIES.name)=@PARAM
ORDER BY MOVIES.name;
 
Hi,
That's not the correct syntax for InStr.
Returns a Variant (Long) specifying the position of the first occurrence of one string within another.
InStr([start, ]string1, string2[, compare])

' A textual comparison starting at position 4. Returns 6.
MyPos = Instr(4, SearchString, SearchChar, 1)

Look it up in Help for more info.
 
Back
Top