Wildcard not functioning

  • Thread starter Tazzy via AccessMonster.com
  • Start date
T

Tazzy via AccessMonster.com

Hi,

I have a fairly simple database based on customers, visits, orders etc. I
have set up a report based on a query that will tell me on which dates
customers have placed orders. In the query criteria for the customer I
entered, quote [Enter Surname] and saved the query.

Obviously whenever I run the report I get the prompt to enter the surname. If
I enter the full surname, Brookes for example then I get the report exactly
as I want for Brookes. However if I enter Bro* then I get nothing returned.
There are no other names that could possibly be returned. This is the same
for all surnames. On going back to the query and trying to run that, exactly
the same result. If I remove the square brackets and contents from the
criteria and put in Bro* - the wildcard works!

This is the same in 2002 and 2003.

Can anyone explain where I may have gone wrong please.

Tazzy
 
V

vanderghast

You may be using an = instead of a LIKE.

You may be typing [Bro*] as value, which dictates to find litterally the
star as a star, not to see it as a wildcard.

You may be using setting which uses % as wildcard, rather than *


Vanderghast, Access MVP
 
T

Tazzy via AccessMonster.com

Hi Vanderghast,

I don't think that the % is the problem, as the query will work fine as Bro*
when I don't use the parameters in the square brackets if you follow me.

How would I check for that particular problem anyhow? To further confuse
things, I can use the square brackets, a parameter and then do a wildcard
search (using*) in other databases on the smae computer, it's just this one
that keeps failing to work properly.

Tazzy
 
J

John W. Vinson

I have a fairly simple database based on customers, visits, orders etc. I
have set up a report based on a query that will tell me on which dates
customers have placed orders. In the query criteria for the customer I
entered, quote [Enter Surname] and saved the query.

If the criteria are in fact just [Enter Surname] then it will find only an
exact match, ignoring wildcards. In order to use wildcards your criterion
should be

LIKE [Enter Surname]

If that's not the issue... Please open the query in design view; select
View... SQL; and copy and paste the SQL view of the query here.
 
T

Tazzy via AccessMonster.com

Thanks John, I see where I went wrong, didn't realise I needed the word LIKE
before the parameter.

Works fine now, appreciate your help.

Tazzy
 

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