Is there a function that can do this:

Search String as one expression only:
"black white"


Result I want to have:
"black"
"white
"black white"
"white black"
"black blue white"


Thanks

Re: String Search by Roger

Roger
Fri Sep 14 02:09:45 PDT 2007

"HerbertDB" <herbertdb@gtech> wrote:

> Is there a function that can do this:
>
> Search String as one expression only:
> "black white"
>
>
> Result I want to have:
> "black"
> "white
> "black white"
> "white black"
> "black blue white"

Not as a single expression but
it's easy enough to break up your
search expression and the use VFP's
InList() function.

-Roger



Re: String Search by Anders

Anders
Fri Sep 14 06:44:07 PDT 2007

SELECT * FROM Table WHERE color like '%black%' OR color like '%white%'

That would include 'blue black'; where neither while nor black is the first
word

-Anders



"HerbertDB" <herbertdb@gtech> wrote in message
news:O5LlqPq9HHA.1208@TK2MSFTNGP05.phx.gbl...
> Is there a function that can do this:
>
> Search String as one expression only:
> "black white"
>
>
> Result I want to have:
> "black"
> "white
> "black white"
> "white black"
> "black blue white"
>
>
> Thanks
>



Re: String Search by HerbertDB

HerbertDB
Sun Sep 16 17:18:21 PDT 2007

Thanks to all.



"Anders Altberg" <anders.altberg> wrote in message
news:u9wivkt9HHA.5360@TK2MSFTNGP03.phx.gbl...
> SELECT * FROM Table WHERE color like '%black%' OR color like '%white%'
>
> That would include 'blue black'; where neither while nor black is the
> first word
>
> -Anders
>
>
>
> "HerbertDB" <herbertdb@gtech> wrote in message
> news:O5LlqPq9HHA.1208@TK2MSFTNGP05.phx.gbl...
>> Is there a function that can do this:
>>
>> Search String as one expression only:
>> "black white"
>>
>>
>> Result I want to have:
>> "black"
>> "white
>> "black white"
>> "white black"
>> "black blue white"
>>
>>
>> Thanks
>>
>
>



Re: String Search by MikeA

MikeA
Wed Sep 19 19:35:33 PDT 2007

How about this:

if "BLACK" $ upper(mystring) .or. "WHITE" $ upper(mystring)
* Found
endif

or this

select * from table where "BLACK" $ upper(color) .or. "WHITE" $ upper(color)

If they are entering the search words (black white) in a text box and you
want to search for all their words then you can easily parse the line and
set it up as a macro.

Mike


"HerbertDB" <herbertdb@gtech> wrote in message
news:ukxPV8L%23HHA.2752@TK2MSFTNGP06.phx.gbl...
> Thanks to all.
>
>
>
> "Anders Altberg" <anders.altberg> wrote in message
> news:u9wivkt9HHA.5360@TK2MSFTNGP03.phx.gbl...
>> SELECT * FROM Table WHERE color like '%black%' OR color like '%white%'
>>
>> That would include 'blue black'; where neither while nor black is the
>> first word
>>
>> -Anders
>>
>>
>>
>> "HerbertDB" <herbertdb@gtech> wrote in message
>> news:O5LlqPq9HHA.1208@TK2MSFTNGP05.phx.gbl...
>>> Is there a function that can do this:
>>>
>>> Search String as one expression only:
>>> "black white"
>>>
>>>
>>> Result I want to have:
>>> "black"
>>> "white
>>> "black white"
>>> "white black"
>>> "black blue white"
>>>
>>>
>>> Thanks
>>>
>>
>>
>
>