>>... where FieldName like '%&MyVar.%'
>>
>>This will return rows where your variable text string is anywhere in the
>field, not just at the beginning of the field.
>
>Mark,
>
>Excuse me for butting in but, will "where FieldName like '%&MyVar.%'" run
>faster than
>"where ATC(myvar, mytable.myfield) > 0"? I am also trying to find a fast
>way of searching
>for strings inside of a character field.
>
>Thanks
>Jerry Tovar
The LIKE clause is pure SQL, while ATC is internal Fox function which is
probably not optimizable. Besides, I think that using '%&MyVar.%' is not
the quickest way to do it - I'd rather build the string
MySearchVar_lc='%'+MyVar+'%'
and then have
"where FieldName like MySearchVar_lc"
instead - why use macro substitution where it's not necessary at all.