Microsoft Office Tutorials and References
In Depth Information
Querying: The Basics
Entering date criteria
All the operators that work for numeric data (see Table 4-1 earlier in this
chapter) also work for data entered in a Date field. For example, you would
enter >7/31/1958 in a Birth Date field to find all people born after (greater
than) July 31, 1958. You would enter Between 1/1/1920 And 12/31/1929 to
retrieve data about people born in the Roaring Twenties.
Access places number signs (#) around date criteria after you enter it. You
can enter dates in these formats:
✦ November 22, 2013
For the purpose of entering two-digit years in dates, the digits 30 through 99
belong to the 20th Century (1930–1999), but the digits 00 through 29 belong
to the 21st Century (2000–2029). For example, >4/1/24 refers to April 1, 2024,
not April 1, 1924. To enter a date in 1929 or earlier, enter four digits instead
of two to describe the year: >4/1/1929 . To enter a date in 2030, or later,
enter four digits instead of two: >4/1/2038 . To avoid any confusion, enter
four-digit years all the time.
The Date() function can come in very handy when you want to retrieve data
relative to today’s date, whatever it happens to be. For example, to retrieve
purchase orders made between January 1, 2009, and today’s date, enter this
expression: Between 1/1/2009 And Date() .
At last — saving and running a query
To save a query and inscribe its name forever in the Navigation pane, click the
Save button on the Quick Access toolbar and enter a descriptive name in
the Save As dialog box. The name you enter appears in the Queries group
in the Navigation pane.
After you laboriously construct your query, take it for a test drive. To run a
✦ Starting from the Query Design window: Click the Run button on the
(Query Tools) Design tab.
✦ Starting from the Navigation pane: Double-click an existing query’s
name, or right-click its name and choose Open on the shortcut menu.