Solved

Query wildcards no longer working

Posted on 2013-06-07
5
375 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
  • 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now