Results 1 to 3 of 3

Thread: LIKE Keyword in ADO

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Isle of Man
    Posts
    276

    Question

    You'll have to forgive me here, but I'm new to ADO!

    I'm trying to select a record from a table called ClientProfile, depending on the value of the Surname column.

    I've used the same statement I would have used with DAO: -
    "SELECT * FROM ClientProfile WHERE Surname LIKE 'D*';"

    This should return the details of Mr Quacky Duck. But it doesn't!

    if I run: -
    "SELECT * FROM ClientProfile WHERE Surname = 'Duck';" I get old Quacky's personals, so I know he's hiding in there somewhere.

    I'm obviously missing something fundamental here. Can anyone shed any light on this one??

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    Change your asterisk to a percent sign:

    "SELECT * FROM ClientProfile WHERE Surname LIKE 'D*';"

    should be

    "SELECT * FROM ClientProfile WHERE Surname LIKE 'D%'"


  3. #3
    Addicted Member
    Join Date
    Jan 2000
    Location
    Oshkosh, WI
    Posts
    163
    Access uses an "*" whereas MS-SQL uses a "%"

    Glenn D
    Development/Analyst

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