General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Making freetext querys to MSSQL
Hallo
I have a question about making SQL-queries to a MS server.
The user has a form with 30 fields, where he can put free text in, as he want, in 1, 2… or all fields.
If I only had one field, I could have build the query like this, and it works perfect:
***
Par=”%some letters%”
=SQLEXEC(MyConnection, "SELECT * FROM MyTable WHERE PATINDEX(?Par,Field1)<>0","Result")
***
BUT. How do I build the query if I want to search throw 2-30 different fields, with an AND between every “PATINDEX”?
I don’t know from the beginning witch fields, or how many fields the user will put text in.
In FoxPro I could build the WHERE-clause as a macro, but it is not a good solution in this case
(I have no full-text index on the database, and I’m using VFP6).
I hope you understand my question
Thanks in advance
/Kjell
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only