Microsoft Access 2010 Bible

(Rick Simeone) #1

Part III: More-Advanced Access Techniques


646


Caution
The expression you enter as the criteria depends on the regional settings (in Control Panel) on the user’s com-
puter. To be safe, you’re better off entering dates in a format compatible with the computer’s regional settings.
For example, in many parts of the world, the date criteria in this example should be entered as 2012/1/1 and
2013/1/1 (or #2012/1/1# and #2013/1/1#, if you choose to include the pound signs yourself).


You’re ready to run your query. Clicking the Query View button on the toolbar returns the first ten
records in the recordset (see Figure 18.10). The actual records returned by this query on your
computer may vary from those shown in Figure 18.10, depending on the data in the query’s
underlying tables.

FIGURE 18.10

Datasheet view of the top ten records in a query


You can specify a percent or numeric value for the top (n) values of a query. This is very helpful
when you want to see only a specific number of records. The Top option can be used with total
queries, which you create later in this chapter, showing the top 5 percent, 15 percent, or any other
value you want to specify. Perhaps you may want to see the top 10 percent in value of buyers in
the system.

In the event of a tie (meaning, more rows fit the query’s criteria than specified by the Top option)
all the matching records are returned. This means that, in some cases, you’ll see more records
returned by a Top(n) query than expected.

How Queries Save Field Selections


When you open a query design, you may notice that the design has changed since you last saved
the query. When you save a query, Access may rearrange (or even eliminate) fields on the basis of
several rules. These rules apply if the Show box is not checked in the QBE pane:
Free download pdf