?
Solved

TQuery Using Wildcards

Posted on 2003-03-03
1
Medium Priority
?
162 Views
Last Modified: 2010-05-18
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
Comment
Question by:Al_Shepstone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
mocarts earned 90 total points
ID: 8056769
try % (percent sign) instead of *
wbr, mo.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month14 days, 6 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question