CCNC/CCNC Module 5/Retrieving data with queries/Query Operations
Designing a new query
Creating queries in design mode allows the most amount of flexibility when building a query. In design mode the query is built from scratch. The designer selects the data source [table(s)] and creates joins between tables (if necessary), adds fields to the query, sets sort order and criteria, adds aliases for column names and other design features.
Starting a new design
To create a new query in design mode select the "Create Query in Design View..." task.
Setting up the query
The first step in designing a new query is to add the tables that the query will be based upon.
Once the tables have been added to the query designer the fields need to be selected. Adding the fields is done by selecting them from the available drop-down menu. If more than one table is a part of the query it is also a good idea to review if the table relationship(s) have become a part of the query. Confirm the relationships can be done by looking for a line joining the two tables. If no line exists one of the two fields that create the join can be dragged and dropped on top of the other. This should create the join.
Once all the fields have been added to the query, sort orders can be applied the fields of the query. Its a good idea to limit the number of sorts to three. After that performance of the query will increase as data in the base table increases.
Test your knowledge