Hi guys,
I'm struggling with this (probably very basic) problem with an SQL query that's supposed to let the user choose a phrase/word that is then searched from a single table but all columns. (Or the ones that are VARCHAR, MEMO & such) It's basically a free classifieds system written in ASP, so there really is only one table, but multiple columns.
I tried to go about it like SELECT * FROM table WHERE col_1 OR col_2 OR col_3 LIKE '%" & Replace(Keyword, "'", "''") & "%' and so forth, but the OR returns every record no matter the word being searched for and if I use AND it returns none. I tried using this link as a advice but had no luck using WHERE CONTAINS, all I got was some really interesting server processing errors about the syntax..
I'd really appreciate all help on this, I really haven't used SQL that much before and I'm pretty much lost.. :/
-J
I'm struggling with this (probably very basic) problem with an SQL query that's supposed to let the user choose a phrase/word that is then searched from a single table but all columns. (Or the ones that are VARCHAR, MEMO & such) It's basically a free classifieds system written in ASP, so there really is only one table, but multiple columns.
I tried to go about it like SELECT * FROM table WHERE col_1 OR col_2 OR col_3 LIKE '%" & Replace(Keyword, "'", "''") & "%' and so forth, but the OR returns every record no matter the word being searched for and if I use AND it returns none. I tried using this link as a advice but had no luck using WHERE CONTAINS, all I got was some really interesting server processing errors about the syntax..
I'd really appreciate all help on this, I really haven't used SQL that much before and I'm pretty much lost.. :/
-J