How to Create Queries Using Microsoft Access 2003

Creating Queries In Access

How to Create Queries Using Access

We have already tackled the introduction to Microsoft Office Access and also seen how to create a database. We are now going to learn how to create queries using Microsoft Access 2003. This tutorial will also help those who are working with Access 2007 or even higher versions, there is no much difference in the principles applied.

Creating Queries in Access

Queries are like questions. We use them to query the database for the information we want. In this way, you are able to display the information you want and in an efficient way. This is the process to follow to create a query.

  • Under the objects, select queries.
  • Click on new.
  • Select design view method, though you can create queries using simple query wizard, crosstab query wizard, find duplicates, and find unmatched query wizard. Then click okay to proceed.
  • On the show table dialog box, select the tables, queries, or both option to define what you want to use to make your query. For instance if you want to use a table to make a query, select the table name and click on add, then click on close.

Creating Queries in Access 2003

Procedure of creating a query
Procedure of creating a query | Source

Creating Queries in Access Database Program

  • The select query dialog box appears. Now, here there are two ways of coming up with a query, you can add the fields you want by double clicking on them, or you can create a query with all the fields. The easiest way to add all the fields is to double click on the blue area to select all of then, then dragging and dropping them on where it is written 'field'.
  • After dragging the fields you want, click on query menu and click on run. This option allows you to display what you wanted to see from your database.
  • To revert to design view of your query, simply go to view and select design view. In design view, you can modify the query the way you want.

To save your query, you can use the option file save as and then give the query a name, or click on close and the computer will prompt you to save your query.

Defining the Source of Your Query Data

Defining what you are going to use to create a query
Defining what you are going to use to create a query | Source

Turning Your Data Into Meaningful Information

Using your query, you can be able to manipulate your data the way you want:

  • You can drag only specific fields you want to the design grid leaving out the ones you do not want.
  • Using the sort option you can be able to sort different fields of your data either in ascending or descending order.
  • Using the show button, you can opt not to show some of the fields by deselecting the show button.
  • You can use the criteria option which allows you to limit or specify the records which are included in the results of a query.

Select Query in Access 2003

Setting the fields you are going to use in your query
Setting the fields you are going to use in your query | Source

Using Criteria in Access 2003

You can use the criteria for instance to display names starting with a certain character. So on criteria under the names;

  • Type J* - this will display all names starting with letter J
  • Type *A* - this will display any name with character A anywhere
  • Type *Y – this will display any name ending with character Y

If you want to display a specific country, on the criteria under country type for instance Kenya. Once you run your query, this will display only patients from Kenya.

Running a Query

Running a Query
Running a Query | Source

Types of Queries You Can Create

To come up with these types of queries you create a normal select query and then in design view you go to query menu and select the query type you want.

  1. Select query – this type of query allows you to select the information you want. Any new query you create is a select query.
  2. Crosstab query – this a query that can be used to calculate a sum, average, count, or other type of total on records.
  3. Make table query – this type of query helps you to create a new table out of your query.
  4. Update query – this query type updates records in the object used to create the query.
  5. Append query – this query type appends or adds records to specified table.
  6. Delete query – as you can guess, this type of query will delete specified records from one or more tables.

Your views

Was this tutorial helpful

See results without voting

© 2012 Patrick Kamau

More by this Author


Comments

No comments yet.

    Sign in or sign up and post using a HubPages Network account.

    0 of 8192 characters used
    Post Comment

    No HTML is allowed in comments, but URLs will be hyperlinked. Comments are not for promoting your articles or other sites.


    Click to Rate This Article
    working