Although the two methods are somewhat different from each other, the basic steps are essentially the same:. After you have created a select query, you run it to see the results. To run a select query, you open it in Datasheet view. If you save the query, you can reuse it whenever you need, for example, as a data source for a form, report, or another query. You can use the Query Wizard to automatically create a select query.
When you use the wizard, you have less control over the details of the query design, but the query is usually created faster than if you did not use the wizard.
Moreover, the wizard can catch some simple design mistakes and prompt you to perform a different action. If you use fields from data sources that are not related to each other, the Query Wizard asks you if you want to create relationships.
The wizard opens the Relationships window for you, but you must restart the wizard if you edit any relationships. Therefore, before you run the wizard, consider creating any relationships that your query needs. For more information about creating table relationships, see the article Guide to table relationships.
On the Create tab, in the Queries group, click Query Wizard. Under Available Fields , double-click the field to add it to the Selected Fields list. If you did not add any number fields fields that contain numeric data , skip ahead to step 9.
If you added any number fields, the wizard asks whether you want the query to return details or summary data. If you want to see individual records, click Detail , and then click Next. Skip ahead to step 9. If you want to see summarized numeric data, such as averages, click Summary , and then click Summary Options.
In the Summary Options dialog box, specify which fields you want to summarize, and how you want to summarize the data. Only number fields are listed. Sum The query returns the sum of all the values of the field. Avg The query returns the average of the values of the field. Min The query returns the smallest value of the field. Max The query returns the largest value of the field. If you want the query results to include a count of the records in a data source, select the appropriate Count records in data source name check box.
If you added a date-time field to the query, the Query Wizard asks you how you would like to group the date values. Note: In Design view, you can use an expression to group by any time period you want, but the wizard only offers these choices. On the last page of the wizard, give the query a title, specify whether you want to open or modify the query, and then click Finish.
If you choose to open the query, the query displays the selected data in Datasheet view. If you choose to modify the query, the query opens in Design view. You can use Design view to manually create a select query. When you use Design view, you have more control over the details of the query design, but it is easier to make design mistakes, and it can take longer than using the wizard. Step 1: Add data sources. Step 2: Join related data sources. Step 3: Add output fields.
Step 4: Specify criteria. Step 5: Summarize data. Step 6: View the results. When you use Design view, to add data sources, you add the data sources and fields in separate steps. However, you can always add more data sources later if you want.
On the Create tab, in the Other group, click Query Design. Double-click each data source that you want to use or select each data source and then click Add. When you add the data sources, if the sources already have relationships defined between them, those relationships are automatically added to the query as joins.
Joins specify how data from related sources should be combined. Access also automatically creates a join between two tables if they have fields have compatible data types and one field is a primary key. You might want to adjust the joins that Access creates. Access determines what type of join to create based on the relationship the join represents. If Access creates a join but there is no defined relationship, Access creates an inner join.
If Access automatically creates the correct joins when you add the data sources, you can skip ahead to Step 3: Add output fields. A split form gives you two views of the data at the same time — a Datasheet view and a Form view. For example, use the Datasheet view to find a record and the Form view to edit it. For more info, see Create a split form. Select a table or query, double-click each field in Available Fields you want to add it to the report, and select Next. For more info, see Create basic reports or Create a simple report.
Table of contents. Access Quick Start. Next: Intro to Access. Table of contents Access Quick Start. Access training. Create a select query Create a query to focus on specific data. Select Simple Query , and then OK.
Create a split form A split form gives you two views of the data at the same time — a Datasheet view and a Form view. The Classic Menu for Office brings back the familiar menus and toolbars to Microsoft Access , , , , and Brings Tabbed User Interface to Office. All rights reserved. Privacy Policy Contact Us If you have any questions or suggestions about our products or web site, please feel free to submit them to us.
0コメント