Query wildcard symbols

Just a heads-up in case this bites you, too.

I migrated an application from Access 2002 to Access 2007.

I have a search form for the users to enter some criteria ... the form 
dynamically builds a SQL WHERE clause before opening a "results" form based 
on an underlying query that includes all the fields available to search on.

Once in Access 2007 format, the search form opens empty every time?!

When I add selection criteria to the underlying query directly, the result 
set is empty every time?!

Oh wait, I'm using the "*" (anything/everything) wildcard character.  Why 
isn't it working?

Nothing in HELP, nothing at Microsoft, nothing via Google, what's going on?!

Bottom line:

Access 2007 comes with the ANSI 92 standard enforced by default.  The ANSI 
92 standard uses the "%" wildcard character, not the "*".

How hard would it be for Access to notice that the query included a "*" in 
the selection criteria and the Like (Alike) operator, but had the ANSI 92 
standard in force?  And offer a little suggestion ... like "try using "%" 
instead of "*""?!

There, I feel a lot better now ... kinda "Primal Screen" therapy...

Jeff Boyce
Microsoft Office/Access MVP


0
Jeff
2/26/2008 5:56:53 PM
access.queries 6343 articles. 1 followers. Follow

4 Replies
1822 Views

Similar Articles

[PageSpeed] 10

thank you for this.   I've taken to scanning this site almost daily always 
looking for 2007 in the question headline to help me learn the differences 
with this newer version....plus have the link to AllenBrowne's info as a 
favorite....
-- 
NTC


"Jeff Boyce" wrote:

> Just a heads-up in case this bites you, too.
> 
> I migrated an application from Access 2002 to Access 2007.
> 
> I have a search form for the users to enter some criteria ... the form 
> dynamically builds a SQL WHERE clause before opening a "results" form based 
> on an underlying query that includes all the fields available to search on.
> 
> Once in Access 2007 format, the search form opens empty every time?!
> 
> When I add selection criteria to the underlying query directly, the result 
> set is empty every time?!
> 
> Oh wait, I'm using the "*" (anything/everything) wildcard character.  Why 
> isn't it working?
> 
> Nothing in HELP, nothing at Microsoft, nothing via Google, what's going on?!
> 
> Bottom line:
> 
> Access 2007 comes with the ANSI 92 standard enforced by default.  The ANSI 
> 92 standard uses the "%" wildcard character, not the "*".
> 
> How hard would it be for Access to notice that the query included a "*" in 
> the selection criteria and the Like (Alike) operator, but had the ANSI 92 
> standard in force?  And offer a little suggestion ... like "try using "%" 
> instead of "*""?!
> 
> There, I feel a lot better now ... kinda "Primal Screen" therapy...
> 
> Jeff Boyce
> Microsoft Office/Access MVP
> 
> 
> 
0
Utf
2/26/2008 8:39:01 PM
Well in a way that is good news for me as I use Oracle a lot which is ANSI 
92. Now if Access would just go to single quotes instead of double quotes in 
SQL statements...

Thanks Jeff!
-- 
Jerry Whittle, Microsoft Access MVP 
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Jeff Boyce" wrote:

> Just a heads-up in case this bites you, too.
> 
> I migrated an application from Access 2002 to Access 2007.
> 
> I have a search form for the users to enter some criteria ... the form 
> dynamically builds a SQL WHERE clause before opening a "results" form based 
> on an underlying query that includes all the fields available to search on.
> 
> Once in Access 2007 format, the search form opens empty every time?!
> 
> When I add selection criteria to the underlying query directly, the result 
> set is empty every time?!
> 
> Oh wait, I'm using the "*" (anything/everything) wildcard character.  Why 
> isn't it working?
> 
> Nothing in HELP, nothing at Microsoft, nothing via Google, what's going on?!
> 
> Bottom line:
> 
> Access 2007 comes with the ANSI 92 standard enforced by default.  The ANSI 
> 92 standard uses the "%" wildcard character, not the "*".
> 
> How hard would it be for Access to notice that the query included a "*" in 
> the selection criteria and the Like (Alike) operator, but had the ANSI 92 
> standard in force?  And offer a little suggestion ... like "try using "%" 
> instead of "*""?!
> 
> There, I feel a lot better now ... kinda "Primal Screen" therapy...
> 
> Jeff Boyce
> Microsoft Office/Access MVP
> 
> 
> 
0
Utf
2/26/2008 9:52:02 PM
Small (but significant) correction ... the "results" form opens empty, not 
the search form.

Jeff

"Jeff Boyce" <nonsense@nonsense.com> wrote in message 
news:ubYT5DKeIHA.5620@TK2MSFTNGP04.phx.gbl...
> Just a heads-up in case this bites you, too.
>
> I migrated an application from Access 2002 to Access 2007.
>
> I have a search form for the users to enter some criteria ... the form 
> dynamically builds a SQL WHERE clause before opening a "results" form 
> based on an underlying query that includes all the fields available to 
> search on.
>
> Once in Access 2007 format, the search form opens empty every time?!
>
> When I add selection criteria to the underlying query directly, the result 
> set is empty every time?!
>
> Oh wait, I'm using the "*" (anything/everything) wildcard character.  Why 
> isn't it working?
>
> Nothing in HELP, nothing at Microsoft, nothing via Google, what's going 
> on?!
>
> Bottom line:
>
> Access 2007 comes with the ANSI 92 standard enforced by default.  The ANSI 
> 92 standard uses the "%" wildcard character, not the "*".
>
> How hard would it be for Access to notice that the query included a "*" in 
> the selection criteria and the Like (Alike) operator, but had the ANSI 92 
> standard in force?  And offer a little suggestion ... like "try using "%" 
> instead of "*""?!
>
> There, I feel a lot better now ... kinda "Primal Screen" therapy...
>
> Jeff Boyce
> Microsoft Office/Access MVP
>
> 


0
Jeff
2/26/2008 10:13:10 PM
On Tue, 26 Feb 2008 13:52:02 -0800, Jerry Whittle
<JerryWhittle@discussions.microsoft.com> wrote:

>Now if Access would just go to single quotes instead of double quotes in 
>SQL statements...

It'll take either in most cases.
-- 
             John W. Vinson [MVP]
0
John
2/27/2008 12:37:36 AM
Reply:

Similar Artilces:

Using a query versus a table for the look up wizard
Hello, I have a field which I would like to use the lookup wizard for to generate a drop down list for the user to select from. My question is whether my databse would run faster if I used: a query from an already established table as the values for the lookup wizard, or to build a new table to hold the information for the lookup wizard to use. I think you'll find few of us recommend the use of the Lookup Wizard. Lookup fields only have a place in tables, and your users should never be working directly with the tables. Create a form, and use a combo box on the form. (See http...

Using Accounting Underlines with Percent Symbols
I'm having a problem using accounting underline with percentages. The accounting underline does not underline the % symbol. Is there any custom percent formatting that could be used with accounting underlines that would make the underline extend under the percent symbol? Accounting underlines only extend to the numbers. Regular underlines extend to the % character. So in your case just switch to regular underlines would be my suggestion. -- HTH... Jim Thomlinson "Jfrossiv" wrote: > I'm having a problem using accounting underline with percentages...

how to write condition in a query
If I wan to perform some calculation in the query if the condition meet, how can combine the below statement tgt in one field? Minutes: IIf([start]>DateAdd("d",-1,[forms]![datedaily1]![date] And [end]<[forms]![datedaily1]![date]),DateDiff("n",[start],[end])) Minutes: IIf([start]<DateAdd("d",-1,[forms]![datedaily1]![date] And [end]<[forms]![datedaily1]![date]),DateDiff("n",DateAdd("d",-1,[forms]! [datedaily1]![date],[end])) Minutes: IIf([start]<DateAdd("d",-1,[forms]![datedaily1]![date] And [end]>[forms]![datedaily...

Pass Through Query Translation
How do I translate this into a pass through query? I've been puzzled over this for a day now? SELECT STORET1_TSRFDACT.START_DATE FROM STORET1_TSRFDACT WHERE ((Year([start_Date])=2008)); I keep getting an error '"YEAR": 'Invalid Identifier' Thanks. Kou Kou Vang wrote: > How do I translate this into a pass through query? I've been puzzled over > this for a day now? > > SELECT STORET1_TSRFDACT.START_DATE > FROM STORET1_TSRFDACT > WHERE ((Year([start_Date])=2008)); > > I keep getting an error '"YEAR":...

How Can I find and replace symbols in excel data ( white square)
I need any input or help Hi try: http://www.mvps.org/dmcritchie/excel/join.htm#trimall -- Regards Frank Kabel Frankfurt, Germany alawhizkid wrote: > I need any input or help ...

I'm SOOO tired of delete queries failing!
running access 2k; I have 2 queries - BOTH should work as far as I can see, and NEITHER does; each reporting "could not delete from specified table". Obviously, they are 2 attempts to complete the same deletion task, which is to delete every record found in the ZQ_delete-dups recordset from the Q_patients recordset. Sounds simple, looks simple, s/b simple, but apparently it's not. I believe either of these would work under sql-server.... Here's the first query: DELETE Q_patients.* FROM Q_patients WHERE (((Q_patients.T_contacts.contact_id) In (select ZQ_delete_dups.contact...

Business Portal "Copy to Excel" not working in Query pages
Hi, I am using Business Portal 4.0. When browsing through one of the queries pages in Business Portal, i clicked "Copy to Excel" icon. I got an error saying "The Office Web Components (OWC) must be installed to copy results to Excel." at the bottom. I am using Office 2007 on my machine. I came to know that Microsoft Office Web Components will no longer be shipping in Microsoft Office. I tried installing Office 2003 Add-in: Office Web Components from http://www.microsoft.com/downloads/details.aspx?familyid=7287252C-402E-4F72-97A5-E0FD290D4B76&displaylang=en a...

Problem importing data via query
When i import data via a webquery from: http://www.x-rates.com/d/EUR/table.html I get different values than on the webpage.. When the webpage says: American Dollar 1.3601 0.73524 Australian Dollar 1.62633 0.614883 Brazilian Real 2.75284 0.363261 I get these values in Excel: American Dollar 13.601 0.73524 Australian Dollar 162.633 0.614883 Brazilian Real 275.284 0.363261 Some values are ten times to high, some are hunderd times to low. Is this because in my version we use comma to seperate decimals? So i see the value 13601 for the US$, and with the...

Help please using a combo box with a query instead of the usual wildcards etc.....
Hi, I have nearly finished my database and I would like to add a query that uses a combo box to get the results, not the usual paramater style input. I suppose it would need a form and a query and a combo box, but where to start !!!!!!!! Any kind soul out there that can give me an example of where to start..........? Many Thanks Joe Joe The generic approach you'd use is: * create a new form, add a combo box that is set to return the value your query would need * create your query ... in the criterion "cell", put a reference to the form's combo box's value: ...

Display Query from form in Foreground
I have a form upon which the user selects display, filter and sort fields. He then clics the submit button and a query is built and then displayed with the following code: DoCmd.OpenQuery "Queryname", acNormal, acEdit The query works but shows up in the background and cant be clicked on until the form is closed. The idea was to create a form on which the user could do adhoc queries until he gets it right and then click another button to do the Excel extract. Is there a way to show the query in the foreground? On Tue, 22 Jan 2008 17:54:27 -0800, rmcompute wrote: > I ha...

Display table name as field in query
Does anyone know if there is a way to display the table name as a field in a query? I have a UNION query that merges all of the records from 10 different tables, but I need a field that indicates which table each record comes from. Any help would be greatly appreciated. Thanks, Craig Craig wrote: >Does anyone know if there is a way to display the table name as a field in a >query? > >I have a UNION query that merges all of the records from 10 different >tables, but I need a field that indicates which table each record comes from. Just use the table name in a calcula...

Aggregate calculations on calculated query fields?
I made a query that uses fields from multiple tables to calculate values for daily metrics. I need to present monthly totals of the data as sums and/or means. The tables are linked by the Date (mm/dd/yyyy) field. I enter ‘between 03/01/2010 and 03/31/2010’ in the criteria for the date field. For the totals I enter ‘group by’ for the date and ‘sum’ or ‘avg’ for the calculated fields. When the query is executed I receive an error that I ‘tried to execute a query that does not include the specified expression *** as part of an aggregate function. *** is the calculated field in the...

Selecting Maximum Values in a Query with joins to other tables
I'm having difficulty with a query and hope someone can help me out. Basically, I'm looking to select the maximum amounts from a table based on a column in one of the tables named StateID. It works fine when I do this: SELECT TOP (100) PERCENT dbo.Bids.StateID, MAX(DISTINCT dbo.Bids.Amount) AS Amount, dbo.States.StateName FROM dbo.Bids INNER JOIN dbo.States ON dbo.Bids.StateID = dbo.States.StateID GROUP BY dbo.Bids.StateID, dbo.States.StateName ORDER BY dbo.States.StateName However, when I start to join fields from other tables in...

Symbol LS4004 Barcode Scaner Helpppppppp !
Please some one, I have a Symbol ls4004 laser scanner, The POS software that im using it with requires that the scanner enters the Tab key after avery scan of a UPC. I feel retarted but I've spent 4 hour going through the manual, trying to program the thing and nothing I do works. I see the Tab barcode that I need to scan, but all I get is error beeps, when I scan new rule and then the tab code, I loose the UPC data, and all I get is the Tab movement. anyone ? please........ I do not have the full idea. but you can try things. first turn off your machine and keep your scanner in y...

LDAP Query #5
I want to setup an Address list (filter) with multiple addresses... This works for one: (&(&(objectCategory=*)(mail=*@abc.com))) this does NOT work for multiple: (&(&(objectCategory=*)(mail=*@abc.com)(mail=*@123.com))) Does anyone know the correct syntax? Thank you for any help! "JHP" <goawayspam@GFY.com> wrote: >I want to setup an Address list (filter) with multiple addresses... > >This works for one: > >(&(&(objectCategory=*)(mail=*@abc.com))) > >this does NOT work for multiple: > >(&(&(objectCategory=*)(ma...

Pass Through query with criteria on a form
I have a Pass Through query that looks like this. select Location,City,State,Country,Pings from (select sd_term_name_loc as 'Location', sd_term_city as 'City', sd_term_st as 'State', sd_term_cntry as 'Country', count(sd_key)as 'Pings' from detail (nolock) where -- ***** The dates below refer to the date and time at which the transaction was loaded to PRM. -- ***** -- ***** The number of pings which have occurred BETWEEN those dates/times will be counted. -- ***** -- ***** Enter the date/time in the format '09/16/2007 14:00:00.000...

Search and replace query
I need to be able to specify my search criteria including leading and/or trailing spaces, and similarly with the replace text. I could not get Excel to accept/handle spaces as part of the search mask. How would I do this? For example if I want to replace all uses of the word he in a database with she how would I specify space he space for the search, and space she space for the replace? TIA Brian Tozer Brian Edit>Replace What: <space>he<space> With: <space>she<space> Works for me. Gord Dibben Excel MVP On Sun, 19 Sep 2004 16:31:09 +1200, "KiwiBrian&...

Queries Versus Views
I have written many Access reports I would now like to make available via MS SS RS. Many of my reports rely on queries that relies on 2-3-4 other queries. Nested queries, sub-queries, whatever you want to call them. Often this is because of differences between the ways I need the data (one row, many columns) and the way it is stored (many rows, one column). What is the most efficient way to deal with nested queries, sub- queries, or whatever in MS SS RS? Create views instead of queries? I don't seem to be able to create one data set based on another... Thanks, Patr...

Work with web query file
How can i get data from a iqy file?? [PS] E:\>dir *.iqy Directory: E:\ Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 10-May-10 10:07 AM 758 owssvr.iqy [PS] E:\>$a = New-Object -ComObject excel.application [PS] E:\>$iqy = $a.Workbooks.Open(".\owssvr.iqy") Exception calling "Open" with "1" argument(s): "'.\owssvr.iqy' could not be found. Check the spelling of the file name, and verify that the file location is correct. If you are trying t...

Calculations, Queries and making it all come together in my table
hello, I am trying to create a very simple database (I'm pretty new to Access). In my main table it have a field call % Safe which is to show the results a calculation. I understand I should create a query. I have two issues - one, the calculation I created doesn't seem to work. I created a simple query based on the fields in my main table, in the query field called % Safe, under Criteria I entered = [# Safe]-[# Unsafe]/[# Safe]. now, I assumed it would look at the data entered in the main table, perform the calculation and BAM present me with answer in this field. ...

Tricky Accounting query
Hi All, Sorry for the 'not so descriptive' subject - but there wasn't enough room to write "Need help with Financial data from multiple tables to follow where a transaction went". :-D I have 8 tables - all identical - for 8 different 'accounts' (not bank accounts, but accounting 'accounts'). I have been asked if I can pull data from the 8 to try and follow a 'transaction' through these accounts. I had thought a crosstab query might do the trick, but was having difficulties in putting it together. So I then started by creating a...

The query could not be processed: Error opening data file
Using Excel 2003. Create a chart and have saved it as a web page and published to a remote share. When I save it locally, it works fine and is interactive,etc.. When I save it remotely and open the htm file in a web browser, it opens like the charting area but the data is not present. Gives error below in the pivot table that appears. Getting error The query could not be processed: o Error opening data file "file://\\remoteserver01\hassan\numbers_files\Numbers_Jan24_12558_cachedata001.xml". Any idea how to fix it ? I want others to access it remotely. Thanks Trying other...

Querying
I have been playing with MS Query in Excel2000, and have noticed that when I type data that contains both numbers and letters, query doesn't recognise it and does not display it. I have tried to format the cell so that it is recognised as text but still it does not recognise it. It is also interesting to note that MS Query puts a decimal point and a 0 behind the data that are numbers. Please tell me what I have to do to make MSQuery recognise data that contains both numbers and letters ...

Queries returning different formats
Hello, I have cut and paste the same expression from a query to another, however when i do this it changes the format of the information returned. In the inital query it returns (Hours:Minutes) perfectly, expression is "LOS (Hours:Mins)": (EDMain!EDDischargeDate+EDMain!EDDischargeTime)-(EDMain!EDPresentationDate+EDMain!EDPresentationTime). When I paste it, it returns a decimal value (which I presume is the way access formats time), and adds '[]' to the expression i.e. "LOS (Hours:Mins)": ([EDMain]![EDDischargeDate]+[EDMain]![EDDischargeTime])-([E...

View/Change Pivot Table Query
I am currently using Excel 2003. I would like to look at a PivotTable's SQL Query, but unsure on how to do this. I did find one posting with a VBA solution, so I tried it. I get the following error: 'Unable to get the Pivot Tables property of the worksheet class' Below is the source code Sub Get_PT_Source_Code() Dim pvtTable As PivotTable Dim index As Integer Set pvtTable = ActiveSheet.PivotTables("PivotTable") With pvtTable.PivotCache Debug.Print .CommandText 'the SQL Query Debug.Print .Connection 'th...