Presentation is loading. Please wait.

Presentation is loading. Please wait.

Queries Help Topics Using the Access 2007, you can press the F1 to pop up the help windows, where you can search the following topics to help to generate.

Similar presentations


Presentation on theme: "Queries Help Topics Using the Access 2007, you can press the F1 to pop up the help windows, where you can search the following topics to help to generate."— Presentation transcript:

1 Queries Help Topics Using the Access 2007, you can press the F1 to pop up the help windows, where you can search the following topics to help to generate the queries and output them in the format of design views, form view or report: –Create a simple select query –Use a query as a recordsource for a form or reportUse a query as a recordsource for a form or report –Create a query based on multiple tablesCreate a query based on multiple tables

2 Example:Create a simple select query -- Create Queries A select query is a type of database object that shows information in Datasheet view (Datasheet view: A window that displays data from a table, form, query, view, or stored procedure in a row-and-column format. In Datasheet view, you can edit fields, add and delete data, and search for data.). A query can get its data from one or more tables, from existing queries, or from a combination of the two. The tables or queries from which a query gets its data are referred to as its recordsource. Whether you create simple select queries by using a wizard or by working in Design view, the steps are essentially the same. You choose the recordsource that you want to use and the fields that you want to include in the query — and, optionally, you specify criteria to refine the results. After you have created a select query, you run it to see the results. Running a select query is simple — you just open it in Datasheet view. You can then reuse it whenever you need, for example, as a recordsource for a form, report, or another query.

3 Build the query 1 On the Create tab, in the Other group, click Query Wizard. In the New Query dialog box, click Simple Query Wizard, and then click OK. Under Tables/Queries, click the table that has the data that you want to use. In this case, click Table: Customers. Note that a query can also use another query as a recordsource. Under Available Fields, double-click the Contact, Address, Phone, and City fields. This adds them to the Selected Fields list. When you have added all four fields, click Next. Name the query London Contacts, and then click Finish. Access displays all of the contact records in Datasheet view. The results show all of the records, but show only the four fields that you specified in the query wizard. Review the initial SQL statement

4 Build the query 2 Click SQL View on the Access status bar; or, right-click the query object tab, and then click SQL View. Access opens the query in SQL view, and displays the following: SELECT Customers.[Contact], Customers.[Address], Customers.[Phone], Customers.[City] FROM Customers; As you can see, in SQL the query has two basic parts: the SELECT clause, which lists the fields that are included in the query, and the FROM clause, which lists the tables that contain those fields. Note If you added the fields in a different order from the preceding procedure, the order that you used will be reflected in the SELECT clause. Close the query, and note that your query is automatically saved.


Download ppt "Queries Help Topics Using the Access 2007, you can press the F1 to pop up the help windows, where you can search the following topics to help to generate."

Similar presentations


Ads by Google