Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the expression LIKE

Status
Not open for further replies.

Ngabay

MIS
May 16, 2003
25
US
Hey guys,

This is probably a quick and easy question. I have a statement using the word Like, I want to be able to search by account names and I want to be able to type in a similar name and get info on that account. i.e. I type IB and I would get IBM. Here is how my statement looks, for some reason the like doesnt work. What am I doing wrong or am I searching the wrong way?


SELECT [InForce D&O Policies].*
FROM [InForce D&O Policies]
WHERE ((([InForce D&O Policies].[Account Name])LIKE[enter account name:]));

Thank you,
Nir




 
Hi

SELECT [InForce D&O Policies].*
FROM [InForce D&O Policies]
WHERE ((([InForce D&O Policies].[Account Name]) LIKE [enter account name:] & "*"));


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Ken,

For a true LIKE expression, shouldn't there also be an * prefixing the account name? e.g:
[tt]
SELECT [InForce D&O Policies].*
FROM [InForce D&O Policies]
WHERE ((([InForce D&O Policies].[Account Name]) LIKE "*" & [enter account name:] & "*"));
[/tt]

Regards,

Darrylle

"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
Hi

Depends what you want eg do you want IBM forllowed my anything, or do you want anything IBM anything

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Ken,

Roger that, NG wouldn't know the distinction is all.

Regards,

Darrylle

"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top