Results 1 to 3 of 3

Thread: How to search in database

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    1

    How to search in database

    When a text is being specified in a text field like "ar", database needs to be searched for a bookname starting with "ar" or any book name with that word.

  2. #2
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    India
    Posts
    276
    How about usign this Query, provided its SQL Server u r using....

    Select BOOK_NAME from TABLE where TEXTFIELD like "%ar%"

    Note: Pls change the Words in Capitals to the appropriate values in the Select Query

    Hope this helps.
    - Jemima.

  3. #3
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Use your database's wildcard character (* for Access, % for SQL Server, etc) which the LIKE statement:
    Code:
    SELECT * FROM Table1
    WHERE SomeName LIKE 'ar%'
    Gets any records in table1 where somename starts with 'ar'.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width