Solved

like keyword in Access

Posted on 2004-04-05
4
230 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

726 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