PDA

Click to See Complete Forum and Search --> : LIKE Keyword in ADO


Jimbob
May 21st, 2000, 10:06 PM
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??

Clunietp
May 21st, 2000, 11:13 PM
Change your asterisk to a percent sign:

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

should be

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

Glenn
May 22nd, 2000, 09:08 PM
Access uses an "*" whereas MS-SQL uses a "%"

:) :)