Solved

SQL HELP

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 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

22 Experts available now in Live!

Get 1:1 Help Now