simple substring query

J

JavaGuru

I'm new to access, with some Transact-SQL experience.
How about this code , it doesn't find the movie "terminator" from the param
"term":

SELECT *
FROM MOVIES
WHERE MOVIES.name LIKE "@PARAM" or name = @param
ORDER BY MOVIES.name;

What can i do to make it work?
/adrian
 
P

PC

SELECT Movies.Name, *
FROM Movies
WHERE (((Movies.Name) Like "Term")) or (((Movies.Name)="Term"))
Order by Movies.Name;
 
V

Van T. Dinh

SELECT *
FROM MOVIES
WHERE MOVIES.name LIKE "*" & [PARAM] & "*"
ORDER BY MOVIES.name;

You need to use the wildcard ("*" above) with the LIKE operator.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top