Microsoft Office Tutorials and References
In Depth Information
Table 22-1. Wildcard Characters in Access
Character
Meaning
Examples
#
Matches a single digit.
A#
True: A0, A9
False: AA, A00
[]
Matches the character or range of
characters specified inside the
brackets. Remember that using an
exclamation point (!) means that the
characters outside the range will
match the value.
A[*]A
Tr ue: A*A
False: AAA
A[D-F]A
True: ADA, AFA
False: AAA, ADAA
A[!0-9]
True: AA, AB
False: A0, A9
When possible, try to limit the use of the Like operators to those columns that are part of an
index. Without the index, the database might have to examine each and every row to find the
rows that match. And, even with an index, you’ll get the best performance if you use the
wildcard characters at the end of the search string.
Note Every database system has its own unique set of wildcard characters. For instance,
the * used by Access is the % in SQL Server. Be sure to make sure that you’re using the
proper wildcard characters in your program.
Sorting Rows
One of the architectural quirks of a relational database is that the database server is free to
return rows in any order. However, you can use the Order By clause to force the database
server to return in the order you specify. For example, the following Select statement retrieves
all the customers from the database in Zip code order:
Select Name, Street, City, State, Zip
From Customers
Order By ZipCode
This Select statement will sort the rows first by Zip code and then within each Zip code by
customer’s name.
Select Name, Street, City, State, Zip
From Customers
Order By ZipCode, Name
Search JabSto ::




Custom Search