ICSOC-8.16.4.1 Query Creation Modes: Simple Query Wizard vs. Query Design View
In Microsoft Access 2016, queries serve as fundamental analytical engines that retrieve, calculate, combine, and filter records from one or more underlying tables into a dynamic virtual dataset known as a dynaset. When initiating a query, users are provided two primary developmental pathways via the Create tab: the Simple Query Wizard and Query Design View. The Simple Query Wizard provides a guided, multi-step graphical workflow ideal for beginners and straightforward extractions. It enables users to select specific fields from multiple tables or queries, pick between detail queries (displaying every single record) or summary queries (automatically performing basic aggregations such as Sum, Avg, Min, or Max), and automatically establishes the underlying SQL SELECT structure without requiring technical query syntax.
While the Query Wizard simplifies rapid baseline query generation, Query Design View provides complete architectural freedom and precision engineering over data retrieval. Query Design View presents a two-pane visual environment comprising the Table/Object Relationship pane at the top and the Query Design Grid (QBE – Query by Example grid) at the bottom. In Design View, database designers can define complex multi-condition filtering criteria, specify multi-field sorting hierarchies, insert calculated expressions using the Expression Builder, configure parameter prompts, and construct table joins. Advanced users can also toggle seamlessly between Design View, Datasheet View (to examine live dynaset output), and SQL View (to directly view or edit the underlying structured query language statement).
ICSOC-8.16.4.2 Design Grid Anatomy: Field, Table, Sort, Show Checkbox, and Criteria Grid Dynamics
The Query by Example (QBE) Design Grid in Microsoft Access functions as the operational command center where field projections, sorting sequences, display visibility, and evaluation rules are configured. The grid is organized into distinct functional rows: Field, Table, Sort, Show, Criteria, and multiple ‘or’ criteria rows. The ‘Field’ row designates the specific attribute or custom calculated expression being evaluated, while the ‘Table’ row explicitly identifies the parent entity or underlying query from which that attribute originates. The ‘Sort’ row enables the user to specify ascending or descending sorting orders across single or multiple fields. Crucially, Access evaluates sort precedence strictly from left to right across the grid; the leftmost sorted column serves as the primary sort key, with adjacent sorted columns functioning sequentially as secondary and tertiary sort tiers.
The ‘Show’ row features interactive checkboxes that dictate whether a given field will physically render in the resulting Datasheet View dynaset. Unchecking the ‘Show’ box is a vital architectural technique when a field is required strictly for filtering criteria or sorting logic (e.g., filtering out inactive accounts or sorting by employee hire date) but should remain hidden from the end-user’s final view. Below the Show row lies the ‘Criteria’ row, followed by sequential ‘or’ rows, which house expression statements, logical operators, and value filters that evaluate every candidate record. The meticulous configuration of these grid rows enables Access to dynamically compile visual grid parameters into optimized SQL statements during query execution.
ICSOC-8.16.4.3 Comparison Operators in Criteria: Equality, Relational Evaluation, and Boundary Logic
In Microsoft Access queries, comparison operators form the mathematical and relational foundation for filtering records within the Design Grid’s Criteria row. Comparison operators evaluate field values against explicit target thresholds, producing a boolean result (True, False, or Null) for each record. The six fundamental comparison operators in Access are: equal to (=), not equal to (<>), less than (<), less than or equal to (<=), greater than (>), and greater than or equal to (>=). If a user enters a raw value into the Criteria row without an operator (such as typing ‘CA’ or 500), Access automatically defaults to the equality operator (=). The inequality operator (<>) selectively extracts all records that deviate from the specified argument, functioning as an exclusion filter.
Relational comparison operators operate across diverse Access data types, following strict formatting and ordering conventions governed by the Jet/ACE database engine. When evaluating numeric types (such as Currency, Long Integer, or Double), operators perform standard mathematical magnitude comparisons (e.g., > 1000). For Date/Time data types, Access automatically encapsulates date literals within hash symbols (#) (e.g., >= #01/01/2024#), where ‘less than’ denotes chronologically earlier dates and ‘greater than’ represents later dates. When applied to Short Text or Long Text fields, comparison operators perform alphabetical collation based on standard ASCII/Unicode sort orders (e.g., < "M" returns all text values beginning with letters from A through L), requiring textual literals to be delimited within double quotation marks.
ICSOC-8.16.4.4 Logical Operator Criteria: AND Evaluation vs. Multi-Row OR Logic in Query Grids
In Microsoft Access query design, multi-criteria filtering hinges upon the precise spatial placement of conditions across the Design Grid to enforce Boolean logic. The fundamental architectural rule dictates that criteria placed on the same horizontal row are evaluated using logical AND, whereas criteria placed across separate horizontal rows are evaluated using logical OR. When criteria across multiple fields occupy the same ‘Criteria’ row (e.g., Department = “Sales” AND Salary > 50000), a candidate tuple must satisfy every single condition simultaneously to qualify for inclusion in the output dynaset. Similarly, multiple criteria entered within a single cell separated by the ‘And’ operator (such as >= 1000 And <= 5000) also assert conjunctive logical AND conditions.
Conversely, entering criteria on separate horizontal rows invokes logical disjunction (OR). If a criterion is entered in the ‘Criteria’ row for one field (e.g., City = “New York”) and another criterion is entered on the immediately succeeding ‘or’ row for another field (e.g., Department = “Finance”), Access evaluates each row independently. A record is retrieved if it fulfills the criteria of row 1 OR the criteria of row 2. Complex compound Boolean expressions—such as (Department = “Sales” AND Region = “North”) OR (Department = “Marketing” AND Region = “South”)—are visually constructed by creating distinct combinations on consecutive grid rows. Misplacing criteria across rows fundamentally alters query semantics, making row discipline essential for data retrieval integrity.
ICSOC-8.16.4.5 Wildcard Criteria Expressions: Pattern Matching with Asterisk, Question Mark, and Character Sets
Wildcard characters in Microsoft Access provide powerful pattern-matching capabilities, enabling queries to search for text patterns when exact strings are unknown, variable, or partially defined. In standard Access databases running under the default ANSI-89 (Jet/ACE) SQL syntax, the primary wildcard operators are the asterisk (*), the question mark (?), the number sign (#), and bracketed character lists ([charlist]). The asterisk (*) represents any sequence of zero, one, or more characters; for example, entering Like “Sm*” matches “Smith”, “Small”, or “Sm”. When placed at both ends (e.g., Like “*tech*”), it acts as a substring locator, retrieving any record containing the token “tech” anywhere within the text string.
In contrast, the question mark (?) serves as a single-character placeholder, matching exactly one alphabetic or alphanumeric character at a precise position. For instance, the expression Like “B?ll” retrieves “Ball”, “Bell”, and “Bill”, but rejects “Bullseye”. The number sign (#) matches any single numeric digit (0-9). Access also supports character ranges within brackets, such as Like “[A-C]*” to match strings commencing with A, B, or C, and the exclamation mark negation operator Like “[!A]*” to exclude strings starting with A. In the Query Design Grid, typing a wildcard expression without the ‘Like’ operator causes Access to automatically prepend ‘Like’ and enclose the string in double quotes upon focus departure.
ICSOC-8.16.4.6 Keyword Filtering Expressions: Between, In, and Null Value Evaluation Architecture
Keyword filtering expressions in Microsoft Access provide concise, highly readable, and mathematically rigorous syntax for evaluating ranges, set memberships, and missing data within the Query Design Grid. The ‘Between … And …’ operator defines an inclusive numeric, chronological, or alphabetical interval, retrieving all values greater than or equal to the lower bound and less than or equal to the upper bound (e.g., Between 100 And 500, or Between #01/01/2023# And #12/31/2023#). It is equivalent to evaluating (Field >= LowerBound AND Field <= UpperBound). Negation is achieved via 'Not Between ... And ...', which filters out all values falling within the closed boundary interval.
The ‘In (…)’ operator facilitates discrete set membership filtering by matching a field against a comma-delimited list of literal values, such as In (“Draft”, “Pending”, “Approved”). This constructs an optimized shorthand for multiple disjunctive OR conditions (Status = “Draft” OR Status = “Pending” OR Status = “Approved”). Crucially, relational databases treat missing, unrecorded, or unknown data as NULL, which represents the complete absence of a value rather than an empty string (“”) or numeric zero (0). Because NULL cannot be evaluated using standard equality comparison operators (e.g., = Null always evaluates to unknown/Null, returning zero rows), Access provides the specialized unary operators ‘Is Null’ (to locate empty records) and ‘Is Not Null’ (to isolate populated records).