A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Wild card not working in Access 2010 query



 
 
Thread Tools Display Modes
  #1  
Old May 27th, 2010, 12:42 AM posted to microsoft.public.access.forms
JayTee
external usenet poster
 
Posts: 9
Default Wild card not working in Access 2010 query

Hi all,
I am wondering if anyone out there knows why the wild card (*) will not work
in an MS Access 2010 query.

I tried, as I have for years, to enter a criteria in a query as follows:
Like "*" & [Forms]![FormName]![FieldName] & "*"
And it creates this
ALike "*" & [Forms]![FormName]![FieldName] & "*" and then won't work
Please help someone as I am at my wits end.
Thanks in advance

JayTee


  #2  
Old May 27th, 2010, 01:52 AM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Wild card not working in Access 2010 query

Depending on how you're using it, you may need to use % as the wildcard, not
*.

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
Co-author: Access 2010 Solutions, published by Wiley
(no e-mails, please!)



"JayTee" wrote in message
...
Hi all,
I am wondering if anyone out there knows why the wild card (*) will not
work in an MS Access 2010 query.

I tried, as I have for years, to enter a criteria in a query as follows:
Like "*" & [Forms]![FormName]![FieldName] & "*"
And it creates this
ALike "*" & [Forms]![FormName]![FieldName] & "*" and then won't work
Please help someone as I am at my wits end.
Thanks in advance

JayTee


  #3  
Old May 27th, 2010, 02:42 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Wild card not working in Access 2010 query

On Wed, 26 May 2010 23:42:52 GMT, "JayTee" wrote:

Hi all,
I am wondering if anyone out there knows why the wild card (*) will not work
in an MS Access 2010 query.

I tried, as I have for years, to enter a criteria in a query as follows:
Like "*" & [Forms]![FormName]![FieldName] & "*"
And it creates this
ALike "*" & [Forms]![FormName]![FieldName] & "*" and then won't work
Please help someone as I am at my wits end.
Thanks in advance

JayTee


Sounds like you've set the database's properties to use SQL/92 format queries
(not sure just how it phrases it). The ALike is the clue. ALike is equivalent
to the SQL/Server syntax of LIKE, and uses % rather than * as the "match any
string" wildcared (also it uses _ rather than ? as the match a single
character). See the online Help for "ALIKE".
--

John W. Vinson [MVP]
  #4  
Old May 27th, 2010, 06:26 PM posted to microsoft.public.access.forms
David W. Fenton
external usenet poster
 
Posts: 3,373
Default Wild card not working in Access 2010 query

"JayTee" wrote in
:

I am wondering if anyone out there knows why the wild card (*)
will not work in an MS Access 2010 query.

I tried, as I have for years, to enter a criteria in a query as
follows: Like "*" & [Forms]![FormName]![FieldName] & "*"
And it creates this
ALike "*" & [Forms]![FormName]![FieldName] & "*" and then won't
work Please help someone as I am at my wits end.
Thanks in advance


Because you're using ALIKE instead of LIKE. ALIKE exists to allow
you to use SQL Server compatible wildcards, in which case you'd use
% in place of * and _ in place of ?.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
  #5  
Old May 27th, 2010, 06:28 PM posted to microsoft.public.access.forms
David W. Fenton
external usenet poster
 
Posts: 3,373
Default Wild card not working in Access 2010 query

John W. Vinson wrote in
:

On Wed, 26 May 2010 23:42:52 GMT, "JayTee"
wrote:

Hi all,
I am wondering if anyone out there knows why the wild card (*)
will not work in an MS Access 2010 query.

I tried, as I have for years, to enter a criteria in a query as
follows: Like "*" & [Forms]![FormName]![FieldName] & "*"
And it creates this
ALike "*" & [Forms]![FormName]![FieldName] & "*" and then won't
work Please help someone as I am at my wits end.


Sounds like you've set the database's properties to use SQL/92
format queries (not sure just how it phrases it). The ALike is the
clue. ALike is equivalent to the SQL/Server syntax of LIKE, and
uses % rather than * as the "match any string" wildcared (also it
uses _ rather than ? as the match a single character). See the
online Help for "ALIKE".


ALIKE works even when you don't have SQL 92 mode turned on.

I've never quite figured out what purpose it serves, to be honest,
as all it does is allow you to use the SQL Server-compatible
wildcards. I don't know if it's compatible with other SQL dialects.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.