Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL HELP

Posted on 2011-02-12
2
Medium Priority
?
364 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
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

971 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