Creating Queries

   

You saw in Chapter 5, "Using Microsoft Query," how to create a simple Select query in Access. The Select query was used as a data source for Microsoft Query, in situations that were too complex for Microsoft Query to manage.

Prior sections in this chapter have discussed joins in greater detail, as well as the implications of choosing names and data types for the fields in the database's tables. The present section builds on those concepts to deal with action queries and criteria in select queries.

The Select query that you saw in Chapter 5 is doubtless the most frequently used type of query. It fulfills several objectives, among them

  • Returning data from one or more tables that are joined by common fields

  • Returning data summaries, such as averages and counts of one field according to different values of another field

  • Calculating new, temporary fields by building expressions based on existing fields

In general, you should use queries in preference to other methods of retrieving or manipulating records in a database because queries' SQL make more efficient use of resources than do other approaches (such as DAO and ADO recordsets).

There are many occasions when you need to resort to recordsets because SQL doesn't meet your needs. For example, you might need to modify the appearance of a form based on the value of a record in a table. But when possible, you should use queries and that includes the action queries: Update, Append, Delete, and Make Table.

Using Update Queries

Use an Update when you want to change the value of a field in some or all of a field's records.



Managing Data with Microsoft Excel
Managing Data with Microsoft Excel
ISBN: 789731002
EAN: N/A
Year: 2003
Pages: 134

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net