AccessLab_Queries - Instructions for the Access Lab...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Instructions for the Access Lab Session: Queries and Expressions Download database lab 2 from the course material folder of WebCourses being sure to save it to the local machine.   On a separate sheet you are provided with the   relationship screen and data found in each table.  Create the following queries.   1. Query concepts: single table queries---selection and criteria and parameters 1. Query concepts: single table queries---selection and criteria and parameters a. Qry1A: List customers ordering 5 or more of any item (include item description and quantity sold with the customer's name.  Sort in descending order according  to quantity sold. b. Qry1B: List each salesperson's name and the total number of item each has sold (hint: use view/totals to add a "Total" row and select Sum on Quantity) Sort in  ascending order by name and descending order on Total Quantity Sold. 2. Query concepts: outer joins/unmatched queries AND using the Is Null criteria function (watch demonstration) 2. Query concepts: outer joins/unmatched queries AND using the Is Null criteria function (watch demonstration) a. a. Qry2A: are their zip codes in the database that no customer lives in? Qry2A: are their zip codes in the database that no customer lives in? b. Qry2B: Find out if there is a customer in the database that has not bought anything. Qry2B: Find out if there is a customer in the database that has not bought anything. c. Qry2C: Find out if there is a product that has not been involved in a sale. Qry2C: Find out if there is a product that has not been involved in a sale. 3. Query concepts: expressions a. Qry3A: List all male customers with their names(concatenated) and ages. [Concatenation of two text fields involves stringing the data in these fields together  by creating a new column in the query.—see below)  To calculate the age of the person you need to use an expression.  The field in the customer table includes  only the year of birth—the easiest way to do this is to put in the “current year” and subtract the “year of birth.”  However, this approach is NOT as flexible  because the “current year” would not change as time goes by.  A better approach would be to use the  DatePart  function in Access to determine the year of the  current date.  The syntax of this using this function is as follows:   CurrentYear: DatePart(“yyyy”, Now())   “Now()” is a function that returns the  current machine date---and then DatePart only shows the portion of the date the designer requests---in this case the four digit year.  For other options look up 
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/07/2010 for the course ACG 3361, 4401 taught by Professor Goldwater,canada,judd,byrd,theniel during the Spring '10 term at University of Central Florida.

Page1 / 6

AccessLab_Queries - Instructions for the Access Lab...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online