Question using LIKE

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have this Query ...

SELECT *
FROM tbCities
WHERE City = [Which City];

It prompts me to enter a City Name & then does the search & returns the
records where the City is = to what I typeed in.

Wich works fine.

However what I would like to do is for this Query to prompt me again but now
return records that are LIKE what I typed in... For example, If I type in A,
then will return all Cities that start with A. I cant get this work.

I know you can have WHERE City LIKE "A*" which will work but this way it
doesnt allow me to type in what I want.

Any help would be greatly appreciated.

Thank you,
Jeff
 
Hello,

I have this Query ...

SELECT *
FROM tbCities
WHERE City = [Which City];

It prompts me to enter a City Name & then does the search & returns the
records where the City is = to what I typeed in.

Wich works fine.

However what I would like to do is for this Query to prompt me again but now
return records that are LIKE what I typed in... For example, If I type in A,
then will return all Cities that start with A. I cant get this work.

I know you can have WHERE City LIKE "A*" which will work but this way it
doesnt allow me to type in what I want.

Try

WHERE City LIKE [Enter City, or part of a city name:] & "*"


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Hi John,

Thank you for your help! This is perfect.

John Vinson said:
Hello,

I have this Query ...

SELECT *
FROM tbCities
WHERE City = [Which City];

It prompts me to enter a City Name & then does the search & returns the
records where the City is = to what I typeed in.

Wich works fine.

However what I would like to do is for this Query to prompt me again but now
return records that are LIKE what I typed in... For example, If I type in A,
then will return all Cities that start with A. I cant get this work.

I know you can have WHERE City LIKE "A*" which will work but this way it
doesnt allow me to type in what I want.

Try

WHERE City LIKE [Enter City, or part of a city name:] & "*"


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top