[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 165
  • Last Modified:

TQuery Using Wildcards

I have a TQuery Component which upon pressing a button is sent the following code.

str:='SELECT *';
str2:='FROM Company INNER JOIN Customer ON Company.[Company No] = Customer.[Company No]';
str3:='WHERE (((Customer.[Last Name]) Like ''Sm*''));';
QuerySearch.Close;
QuerySearch.SQL.Clear;
QuerySearch.SQL.Add(str);
QuerySearch.SQL.Add(str2);
QuerySearch.SQL.Add(str3);
QuerySearch.Open;

I have two test entries in the table one called Smith the other Smyth.

If i press the button a dbgrid linked to the table is empty, however if  i change str3 to search for Smith a the dbgrid  displays my entry.

If I change str3 to Smyth again my grid shows the correct entry

How can i get the grid to show both entries?

0
Al_Shepstone
Asked:
Al_Shepstone
1 Solution
 
mocartsCommented:
try % (percent sign) instead of *
wbr, mo.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now