hey guys, maybe someone knows an easy way to do this...if not, i have to write my own subroutine.
anyways, i have 3 fields in a SQL table....call them field1, field2, field3.
in an active server page, the customer will have the ability to type several words into a text box and then hit a search button. upon doing so, i want to bring back all records where a word in the text box equals or is contained in one of the three fields in my table.
for instance, let's say the user types in : screw hammer desktop
now i want to search in fields 1, 2, and 3 for all instances where screw, hammer or desktop are contained somewhere in the fields. maybe there is only 1 part that contains screw, or maybe there are 5 parts that contain the word screw, 8 parts that have hammer, and 2 parts that have desktop.
does anyone know of a quick way to submit this in a SQL statement and bring back all records where at least one record has at least one word that was entered in at least one of the fields?? i'd appreciate all feedback
EDIT: i was thinking something like this:
let the string of text entered by the user be set to the variable "strText"
then the sql statment could be something like:
sSql = "select * from Table where " & strText & " is contained in field1 or field2 or field3"
would something like that work?
anyways, i have 3 fields in a SQL table....call them field1, field2, field3.
in an active server page, the customer will have the ability to type several words into a text box and then hit a search button. upon doing so, i want to bring back all records where a word in the text box equals or is contained in one of the three fields in my table.
for instance, let's say the user types in : screw hammer desktop
now i want to search in fields 1, 2, and 3 for all instances where screw, hammer or desktop are contained somewhere in the fields. maybe there is only 1 part that contains screw, or maybe there are 5 parts that contain the word screw, 8 parts that have hammer, and 2 parts that have desktop.
does anyone know of a quick way to submit this in a SQL statement and bring back all records where at least one record has at least one word that was entered in at least one of the fields?? i'd appreciate all feedback
EDIT: i was thinking something like this:
let the string of text entered by the user be set to the variable "strText"
then the sql statment could be something like:
sSql = "select * from Table where " & strText & " is contained in field1 or field2 or field3"
would something like that work?