Difficulty with LIKE operator

K

K Ravi babu

I am trying to use LIKE operator in a query. Whenever I type LIKE "xx*" and
enter, the word LIKE is automatically becoming ALIKE and the query is
failing. why this is happening? And, how can i come out of this
difficluty. Can any one help?

I have tried the following remedy:
I have repaired the MS office. Still the problem is not gone..

Please help
 
A

Allen Browne

Uncheck the SQL Server Compatible Syntax box.

In A2003 and earlier, it's under Tools | Options | Tables/Queries.
In A2007, click the Office button (top left), then Access Options (bottom of
dialog.)

It's not well documented, but the ALIKE operator uses the SQL Server wild
cards (% rather than * etc.)
 
P

Petr Danes

Never heard of anything quite like that, but there are three things I would
try right off the bat:

1. -Immediately- after the LIKE is changed to ALIKE, try pressing CTRL/Z.
That will undo changes, one step at a time, and just may undo that last,
unwanted change to ALIKE.

2. Look to see if you have auto-correct on and if LIKE and ALIKE are in the
auto-correct list. It should have enough sense not to auto-correct inside
the text of a query, but with Office, you never know what someone at MS will
think is cool feature.

3. I'm assuming this happens in the graphic query window. Try assembling the
query in SQL view and see if the unwanted change happens there as well.

Petr
 
K

K Ravi babu

Dear Allen Browne,
Thank you verymuch. Its great. It worked. I was struggling over a week on
the problem. But you saved me of great effort and time.
Thanks
 
P

Petr Danes

Good one. I had no idea about that, but you can bet I will remember it.
Glad that people smarter than me cruise these groups as well.

Petr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top