Query search question

R

ryan.fitzpatrick3

I download a list of information onto a table, and i'd like to make a
search on that item. I put in "*" & [Search Item] & "*" into the
item field with the wildcards just in case. This works fine. Now lets
say I'm looking up cars, so in the search input box that pops run when
I run the query I type in dodge and that brings backs dodge matches.
If I want to look up red dodges do I put

like "red" and "*" & [Search Item] & "*" or "red" &"*" & [Search Item]
& "*" ?

I've tried both and it works only if red dodge is next to each other
but if it's red white dodge, it wouldn't pick that item up. Is there
away to program a color into the search field where it would bring
back all red dodges even though the words are not next to each other?

Also can I type in two colors like "red" or "yellow" and "*" & [Search
Item] & "*"

and lookup mutliple colors? Thank you.

Ryan
 
J

Jeff Boyce

It may be simple typos, but your two options are not very similar...

One uses the word "and" where the other uses the ampersand ("&").

One has spaces between each pair of elements and the other seems to be
missing a space.

If I were trying to find something with "red" followed (somewhere) by
"dodge", I'd probably first try (untested):

Like * & "red" & * & [Enter Car Manufacturer] & *

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
D

Douglas J. Steele

I believe you need quotes around the asterisks:

Like "*" & "red" & "*" & [Enter Car Manufacturer] & "*"

or

Like "*red*" & [Enter Car Manufacturer] & "*"



--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Jeff Boyce said:
It may be simple typos, but your two options are not very similar...

One uses the word "and" where the other uses the ampersand ("&").

One has spaces between each pair of elements and the other seems to be
missing a space.

If I were trying to find something with "red" followed (somewhere) by
"dodge", I'd probably first try (untested):

Like * & "red" & * & [Enter Car Manufacturer] & *

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

I download a list of information onto a table, and i'd like to make a
search on that item. I put in "*" & [Search Item] & "*" into the
item field with the wildcards just in case. This works fine. Now lets
say I'm looking up cars, so in the search input box that pops run when
I run the query I type in dodge and that brings backs dodge matches.
If I want to look up red dodges do I put

like "red" and "*" & [Search Item] & "*" or "red" &"*" & [Search Item]
& "*" ?

I've tried both and it works only if red dodge is next to each other
but if it's red white dodge, it wouldn't pick that item up. Is there
away to program a color into the search field where it would bring
back all red dodges even though the words are not next to each other?

Also can I type in two colors like "red" or "yellow" and "*" & [Search
Item] & "*"

and lookup mutliple colors? Thank you.

Ryan
 
J

Jeff Boyce

Doug

I'm ... "efficient" (when other folks do it, it's being "lazy").

When I enter as I posted into the Access Query design view grid, Access adds
the proper quotification.

Of course, if I were working directly in a SQL statement, I would have to be
less ... "efficient".

Regards

Jeff Boyce
Microsoft Office/Access MVP


Douglas J. Steele said:
I believe you need quotes around the asterisks:

Like "*" & "red" & "*" & [Enter Car Manufacturer] & "*"

or

Like "*red*" & [Enter Car Manufacturer] & "*"



--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Jeff Boyce said:
It may be simple typos, but your two options are not very similar...

One uses the word "and" where the other uses the ampersand ("&").

One has spaces between each pair of elements and the other seems to be
missing a space.

If I were trying to find something with "red" followed (somewhere) by
"dodge", I'd probably first try (untested):

Like * & "red" & * & [Enter Car Manufacturer] & *

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

I download a list of information onto a table, and i'd like to make a
search on that item. I put in "*" & [Search Item] & "*" into the
item field with the wildcards just in case. This works fine. Now lets
say I'm looking up cars, so in the search input box that pops run when
I run the query I type in dodge and that brings backs dodge matches.
If I want to look up red dodges do I put

like "red" and "*" & [Search Item] & "*" or "red" &"*" & [Search Item]
& "*" ?

I've tried both and it works only if red dodge is next to each other
but if it's red white dodge, it wouldn't pick that item up. Is there
away to program a color into the search field where it would bring
back all red dodges even though the words are not next to each other?

Also can I type in two colors like "red" or "yellow" and "*" & [Search
Item] & "*"

and lookup mutliple colors? Thank you.

Ryan
 

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