Solved

SQL HELP

Posted on 2011-02-12
2
344 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 142

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to open a new windows chrome resized and disabled the toolbar? 3 110
Delphi inherited method 6 67
Unique identifier on a terminal server (rdp) 4 51
Base1 Encode/Decode 3 77
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…
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 Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

815 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now