Selasa, 21 Mei 2013

RE: [MS_AccessPros] Using ALIKE in a query

 

Bill-

I very very vaguely recall running across ALIKE before, but can't remember
why. It's not even in Help, so I have no clue what it's supposed to do
(other than screw up your queries). Thanks for the heads up.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Bill Mosca
Sent: Monday, May 20, 2013 3:27 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Using ALIKE in a query

Well, gang, this old dog just stumbled onto a new trick. In the sample
database Northwind.mdb, the Customers table has a primary key named
CustomerID. This field has an input mask of >LLLLL which apparently acts
as a validation rule that says it has to be 5 characters long.

If you create a query in design view and put this in the criteria line for
the CustomerID field:
LIKE "A*"

it gets changed to:
ALIKE "A*"

That returns nothing. It seems that the validation rule is preventing the
wildcard. You have to do it this way:
ALIKE "A____"

That's A and 4 underscores. In all my years of working with Access I had
never heard of ALIKE

Do yourselves a favor and use input masks at the form level, not at the
table level. Users shouldn't be doing anything at table level anyways.

Regards,
Bill Mosca, Founder - MS_Access_Professionals http://www.thatlldoit.com
Microsoft Office Access MVP
https://mvp.support.microsoft.com/profile=C4D9F5E7-BB03-4291-B816-6427073088
1E
My nothing-to-do-with-Access blog
http://wrmosca.wordpress.com

------------------------------------

Yahoo! Groups Links

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar