PDA

View Full Version : Access 2002 query problem


Jon
05-08-03, 06:48 PM
I am working on a customer database and need to query with a prompt on customer name.

The criteria I am using in this'

Like "*" & [Enter Customer Name to Search]

I am using this criteria in the customer field.

I want to be able to type as few characters as possible and have the query return all customers that fit the criteria.

The criteris above only returns the customers whose last name ends in the criteria specified.

for example

If I query Ad for ADAMS, SAM

the query will not find Sam Adams it will find Bock, Pad.

What do I have to change in the criteria to get it to do what I want?

LukeMan
05-09-03, 12:18 AM
Your problem is that "Like *ad" means find any customer name that starts with anything BUT ends with ad thus you get mr Pad.

What you want to use is something like this:

Like "S*" For a ShipName field, orders shipped to customers whose name starts with the letter S
Like "S%" For a ShipName field, orders shipped to customers whose name starts with the letter S

Should work straight from the help on Access, haven't messed with it a bit but, I use that in query on an IBM AS400 but it's pretty standard SQL.

Give it a whirl......