Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String within a string

Status
Not open for further replies.

amwprogg

Programmer
Jul 8, 2005
52
GB
Hi all.
I have a SQL Select statement and I want to select only the records where the "activity" character field contains a pre-defined string. The code is like:
SELECT * FROM table ;
WHERE THISFORM.activity_search.Value$table.activity=.T. ;
INTO CURSOR tmpcursor
Will that do it, because it doesn't seem to select any of the records, and I know for a fact they contain the search
string?
Many Thanks.
Andy.
 
Code:
** Do not use objects directly in select
lcActivity = [%]+ALLTRIM(THISFORM.activity_search.Value)+[%]

SELECT * FROM tabl ;
         WHERE table.activity LIKE lcActivity;
INTO CURSOR tmpcursor

Keep in mind that all selects that uses LIKE, $ are very slow

Borislav Borissov
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top