Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Options for avoiding SET FILTER
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00325835
Message ID:
00325848
Views:
27
>
select * from q:\qa\qdms2000\qdms!document where title like l_cSearchtext
>   into cursor temp
>
>
>where l_cSearchText = "%some_value%"
>
>Preceding and ending the string with the percent sign is the SQL way of looking for that string anywhere in the field.
>
>Value% means the beginning of the field has to start with the value but acn end with anything.
>
>__Value [that is value preceded by 2 underlines] means the first 2 characters can be anything. 1 Underscore per character [DOS equivalent to ? per character].
>
>where LastName like Sm_th% would find all like Smith, Smythe, Smithsonian, etc.

So the "$" operator should not be used in SQL? Also, then, it would appear that I have to take the text the user enters for SearchText and add the percent signs to the beginning and end of it before using that variable in the SQL statement?

It seems I am always one question away from the answer! *g*
Phil Thomas
http://phillipdthomas.com

Never let your energy or enthusiasm be dampened by the discouragements that must inevitably come.....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform