Board index » delphi » SQL searching par of string

SQL searching par of string

i'm trying to write an SQL-statement which can search all records
where my searchstring is part of the client-name.

any ideas

Freddy
pub01...@innet.be
.

 

Re:SQL searching par of string


Quote
Biets Freddy wrote:

> i'm trying to write an SQL-statement which can search all records
> where my searchstring is part of the client-name.

> any ideas

> Freddy
> pub01...@innet.be
> .

Steve Koterski (Borland International) wrote:

  SELECT *
  FROM "MYTABLE.DB" M
  WHERE M."FIELD1" LIKE "Z%" OR
    M."FIELD2" LIKE "Z%"
    M."FIELD3" LIKE "Z%"
    .
    . and so on

The % (wildcard) operator replaces a variable number of characters in
the
search value template. The _ (character substitution) operator replaces
a
single character. Thus "%Z" will file all records where the search field
ends with "Z", preceeded by any number of characters. "_Z%" would find
the
records where the search field had "Z" as the second character, followed
by
any number of characters.

Hope it helps

Rkr
--
                   \|||/
                   /'^'\
                  ( 0 0 )
--------------oOOO--(_)--OOOo--------------
. Reid Roman                              .
. Delphi Programmer / Analyst             .
. TVisualBasic:=class(None);              .
-------------------------------------------
. Auto-By-Tel (http://www.autobytel.com)  .
. Irvine, CA U.S.A                        .
. E-Mail : rkroman (at) pacbell (dot) net .
. or reidr (at) autobytel (dot) com       .
-------------------------------------------

Other Threads