Solved

SQL HELP

Posted on 2011-02-12
2
351 Views
Last Modified: 2012-06-21
I am trying to search a field (Caption) in a table.
I know there is (Joey Owens) in the database.
If i type the edit box (Joey Owens) it will find that record just fine.

If i type in Joey by itself it will not find that record.
If I type in Owens by itself it will not find that record.

How can I locate that record by just useing Joey Or Owens ?
with dataModule2.SearhQuery do begin
  Close;
  SQL.Clear;
  SQL.Add('SELECT * FROM Events WHERE Caption =:Name');
  Parameters.ParamByName('Name').Value:= edit1.Text;
  Open;

Open in new window

0
Comment
Question by:Grant1842
[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
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 34880407
the + and '' will depend on the sql language you are using ...
  SQL.Add('SELECT * FROM Events WHERE Caption LIKE ''%'' + :Name + ''%'' ');
0
 
LVL 12

Author Closing Comment

by:Grant1842
ID: 34880416
Just What I needed. THanks
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

Suggested Solutions

Title # Comments Views Activity
SUM 2 INTEGER ARRAYS INTO 1 10 117
Installshield for Embarcadero EX 10.1 Berlin 4 92
Delphi: sending SMS on android platform 1 104
Way to create an iPhone app for my customers 8 90
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…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

739 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