Hi
I have a simple search field in my form. I am trying to use it to search for a string within my 'Keywords' column.
I am using this at the moment:
SELECT DevelopmentID, Name, Town
FROM tblDevelopments
WHERE Keywords Like %@Keyword%' AND Live=Yes
ORDER BY Name;
but it return nothing and doesn't even ask me for the @Keywords parameter.
If I loose the "'" from either end I get a syntax error.
I can get a result of sorts if I simply use LIKE @Keywords, but it doesn't work as expected. Say my keywords column contains Castle Street Industrial and someone types in Industrial, it will not return any results. I would only get results if i searched forCastle Street Industrial.
I seem to have forgotten how to search for a string within the keyword field.
I can tell I'm being stooopid here.
Where am I going wrong?
Cheers
Shaun
I have a simple search field in my form. I am trying to use it to search for a string within my 'Keywords' column.
I am using this at the moment:
SELECT DevelopmentID, Name, Town
FROM tblDevelopments
WHERE Keywords Like %@Keyword%' AND Live=Yes
ORDER BY Name;
but it return nothing and doesn't even ask me for the @Keywords parameter.
If I loose the "'" from either end I get a syntax error.
I can get a result of sorts if I simply use LIKE @Keywords, but it doesn't work as expected. Say my keywords column contains Castle Street Industrial and someone types in Industrial, it will not return any results. I would only get results if i searched forCastle Street Industrial.
I seem to have forgotten how to search for a string within the keyword field.
I can tell I'm being stooopid here.
Where am I going wrong?
Cheers
Shaun