Solved

Query wildcards no longer working

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
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…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

789 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