Solved

Query wildcards no longer working

Posted on 2013-06-07
5
380 Views
Last Modified: 2013-06-25
I'm having issues using the # wildcard character in an Access query.  Previously, I've had no issues whatsoever, but now I cannot get any results returned with one.  

The search criteria

Like "*test*local"    returns

233test.local
469test.local
578test.local
233test.local

but Like "###test*local" returns nothing.  

This query used to work, but after moving the tables to a new database, it no longer functions.  Am I missing something?

Thanks.
0
Comment
Question by:jyost
[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
  • 2
  • 2
5 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39229325
Did you move the data to SQL Server (or a SQL compatible Access database), or are you using an ADO recordset?

If so, you may have to change your wildcards to:


Like "[0-9][0-9][0-9]test%local"
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39229411
If that doesn't help out, post your query's SQL.
0
 
LVL 11

Expert Comment

by:datAdrenaline
ID: 39229552
What is the option you have set for the option named "SQL Server compatible syntax (ANSI 92)"?

In A2010:
File | Options | Object Designers | Query Design | SQL Server compatible syntax (ANSI 92)

By the way ... you are speaking of an Access Query object right?
0
 

Author Comment

by:jyost
ID: 39229633
Mbizup:  The [0-9][0-9][0-9] syntax worked.  Thanks.  I didn't change anything in the databases to make them SQL compatible though.

datAdrenaline: I have nothing checked in those options. "This database" is grayed out and "default" is unckecked.  What would this change?  If those were checked, could I use different syntax?

Thanks to both.
0
 
LVL 11

Expert Comment

by:datAdrenaline
ID: 39275036
"What would this change?  If those were checked, could I use different syntax?"

The only way that changes is if someone does it.  Many times people experiment with settings and don't see an immediate visual difference.

If you change that option, you Query objects would have to be written in ANSI 92 compliant syntax.

For more info, check out the following:
http://office.microsoft.com/en-us/access-help/about-ansi-sql-query-mode-mdb-HP003070483.aspx
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
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.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

733 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