Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Tips Database Forum Rss Feed

» Database Journal Home
» Database Articles
» Database Tutorials
MS Access
SQL Scripts & Samples
» Database Forum
» Slideshows
Free Newsletters:

News Via RSS Feed

Rss Feed

Database Journal |DBA Support |SQLCourse |SQLCourse2

Featured Database Articles

MS Access

Posted Feb 2, 2004

MS Access for the Business Environment: Access Query Techniques: Subqueries, Part II

By William Pearson

About the Series ...

This article continues the series, MS Access for the Business Environment. The primary focus of this series is an examination of business uses for the MS Access relational database management system. The series is designed to provide guidance in the practical application of data and database concepts to meet specific needs in the business world. The majority of the procedures I demonstrate in this article and going forward will be undertaken within MS Access 2003, although most of the concepts that we explore in the series will apply to earlier versions of MS Access, as well.

For more information on the series, as well as the hardware / software requirements to prepare for the tutorials we will undertake, please see Tutorial 1: Create a Calculated Field with the Expression Builder.

Introduction to this Tutorial

In the lesson just before our last, Access Query Techniques: Subqueries, Part I, we introduced subqueries within the context of MS Access, and practiced their creation and use to help us to meet an illustrative business need. As a part of our exploration of subqueries, we examined the syntax surrounding the use of a straightforward sample subquery, and then began a hands-on example of the use of a subquery in a multi-step practice exercise. After evolving an initial query, we created a second query, within which we nested the first, to demonstrate the operation of a subquery in our practice exercise. We then discussed various aspects of the results datasets that we obtained in each step of the practice examples.

In our last article, Access Query Techniques: Using the TOP Keyword, we took a break from subqueries to examine the TOP keyword, both to illustrate its use in meeting another illustrative business need, and to prepare us for this lesson, where we will use the keyword in a continuing exploration of subqueries. We overviewed the TOP keyword, getting a taste of its operation in an undistracted scenario, and are now ready to proceed to the creation of a subquery that leverages TOP to illustrate more sophistication in the use of subqueries. We examined the syntax surrounding the use of TOP, together with its "modifier" keyword PERCENT, then performed practical examples of their uses to meet illustrative business needs. Finally, we discussed the results datasets that we obtained in each of the practice examples.

The objective of this lesson is to further delve into MS Access subqueries to render results that are more sophisticated for organizational information consumers. To accomplish this, we will introduce the use of the TOP keyword within another subquery scenario, in a series of steps that include:

  • an examination of the syntax surrounding the use of the subquery;
  • details of a "real world" need that can be met with the use of the TOP keyword in a subquery scenario;
  • an examination of the operation of the TOP keyword within the subquery;
  • a brief discussion of the results datasets that we obtain in each step of the practice example, and how they meet the business need objectives.

We will use the Northwind sample database that installs with MS Access for purposes of this lesson, in an attempt to make our discussion useful to virtually anyone who has access to the application.

MS Access Archives

Latest Forum Threads
MS Access Forum
Topic By Replies Updated
Help With Microsoft Access kasy 0 September 4th, 07:35 PM
Linked table not sorting or filtering - ODBC error Java 1 August 28th, 10:37 AM
Use Parameter in select statement (Sql in Microsoft Access) katty.jonh 1 July 25th, 06:45 AM
Query Issue algebroni 7 July 23rd, 04:22 PM