Solved

like keyword in Access

Posted on 2004-04-05
4
195 Views
Last Modified: 2006-11-17
i want to use like operator in MSAccess 2002. what should i do ? it is not working ?
any solution ?
the query is : "select * from emp where emp_name is like 'tom%'
thanks
0
Comment
Question by:realistic27
4 Comments
 
LVL 54

Accepted Solution

by:
nico5038 earned 40 total points
ID: 10756621
Try:
like 'Tom*'

Nic;o)
0
 
LVL 3

Expert Comment

by:SiJP
ID: 10756783
As per the above, when you are creating SQL statements in access you are not using TransactSQL, but JetSQL .. the % operator becomes *.

There are some differences between the two, so well worth checking for other statments you create, if they do error.

Full statement you need:

"SELECT * FROM emp WHERE emp_name LIKE 'tom*'"

or to use a variable:

"SELECT * FROM emp WHERE emp_name LIKE '*" & strVariable & "*'"
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now