Shelly Cashman Access 365 | Module 2: SAM Critical Thinking Project C Connect Marketing Group
CREATING QUERIES
· Excel Projects Help

GETTING STARTED
1. Save the file SC_AC365_CT2C_FirstLastName_1.accdb as SC_AC365_CT2C_FirstLastName_2.accdb
a. Edit the file name by changing “1” to “2”.
b. If you do not see the .accdb file extension, do not type it. The file extension will be added for you automatically.
2. To complete this Project, you will also need the following files:
Support_AC365_CT2C_AccountData.xlsx
3. With the file SC_AC365_CT2C_FirstLastName_2.accdb open, ensure that your first and last name is displayed as the first record in the _GradingInfoTable table.
a. If the table does not display your name, delete the file and download a new copy.
PROJECT STEPS
1. Connect Marketing Group is a national company that provides marketing services such as contact research, brand building, and merchandising to retail stores. As a sales analyst, you need to query the database to help make decisions and to answer questions from other employees. Create a query based on the Contacts table with the following options to list contacts and their birthdates:
a. Add the ContactID, FirstName, LastName, and DateOfBirth fields to the design grid in that order.
b. Sort the records in Ascending order by LastName.
c. Save the query using ContactLastNameSorted as the query name. Display the results of the query, then close it.
2. Modify the AccountBillings query as follows to select accounts with monthly billings over $500:
a. Delete the ContactID column from the design grid.
b. Add criteria to select only those records with monthly billings greater than 500.
c. Save the changes to the AccountBillings query. Display the results of the query, then close it.
3. Modify the HighBillOrContract query to select only those records with monthly billings greater than 1000 or contract totals greater than 2000000. Save the changes to the query. Display the results, confirm that they include 6 records, then close the query.
4. Modify the ContactBirth query as follows to list contacts with birthdates before January 1, 1990:
a. Add the FirstName field to the query design grid immediately after the ContactID field.
b. Add criteria to select only those records with birthdates less than 1/1/1990.
c. Display the birthdates using the Medium Date format.
d. Use BirthDate as the caption of the DateOfBirth field.
e. Save the changes to the ContactBirth query. Display the results, confirm that they match Figure 1, then close the query.
Figure 1: ContactBirth Query Results
5. Modify the StateCitySort query as follows to organize contacts first by state and then by cities within each state:
a. Move the State field to the beginning of the design grid so that the order of the fields in the grid is State, City, FirstName, and LastName.
b. Sort the records in Descending order by the State field and in Ascending order by City. Save the changes to the query. Display the results of the query, then close it.
6. Modify the HighBillAndContract query to select only those records with monthly billings greater than 1000 and contract totals greater than 2000000. Save the changes to the query. Display the results, confirm that they include 1 record, then close the query.
7. Modify the FloridaContacts query to select only those records where the contact resides in FL. Save the changes to the query. Display the results, confirm that they include 4 records, then close the query.
8. You need to find a contact from a particular city, but you know only that the city name begins with "Ba". Modify the ContactCity query to select only those records where the City field value begins with Ba. Save the changes to the query. Display the results, confirm that they include 3 records, then close the query.
9. Create a query as follows to display the contact name rather than the contact ID for each account:
a. Add the LastName field from the Contacts table to the design grid.
b. Add the AccountNumber and ContractTotal field from the Accounts table to the design grid.
c. If necessary, join the Contacts table and the Accounts table by drawing a line from the ContactID field in the Contacts table to the ContactID field in the Accounts table. (Hint: Because the field names are identical in both tables, the join line may already appear in Design View. Do not attempt to recreate the line if it is already present.)
d. Save the query using Contact-Account as the name. Display the results of the query, confirm they include 29 records, then close the query. (Hint: after the completion of step 18, the Contact-Account query will include 34 records.)
10. You often want to list contacts from a particular state, which varies depending on the information you need. Modify the StatesParameter query as follows:
a. Replace the current criterion for the State field with parameter criteria that uses Enter desired state as the prompt text.
b. Save the changes to the query.
c. Display the results of the query. Enter OR when prompted. Confirm that 3 records appear in the results, then close the query.
11. Modify the TopValuesBillings query to list the accounts with the five highest monthly billings. Sort the MonthlyBill amounts in Descending order. Change the Return value to display only the top 5 records. Save the query. Display the results then close the query.
12. Modify the AnnualPayments query to include a calculated field that determines the annual payment from each account. Enter AnnualPayment: [MonthlyBill]*12 in the Zoom dialog box of the first empty column in the design grid. Save the query. Display the results then close the query.
13. Modify the AverageBillings query as follows to list the average monthly bill for all active accounts:
a. Add a Totals row to the design grid.
b. Select Avg as the calculation in the Total row.
c. Set the caption to Avg Billing for the MonthlyBill field. Save the changes to the query. Display the results, confirm that they match Figure 2, then close the query.
Figure 2: AverageBillings Query Results
14. Modify the ContactsWithoutAccounts query as follows to identify contacts who are not assigned to accounts:
a. Change the join property for the relationship between the Contacts and Accounts tables to select ALL records from the Contacts table and only those records from the Accounts table where the joined fields are equal.
b. Add the Is Null criterion for the AccountNumber field and sort the LastName field in Ascending order. Save the changes to the query. Display the results, confirm that they include 23 records, then close the query.
15. Modify the UniqueStates query to list all states only once. Save the changes to the query. Display the results, confirm that they include 24 records, then close the query.
16. Create a crosstab query based on the WestCoast table with the following options to list the total number of contacts in each city on the west coast:
a. Use only data from the WestCoast table in the crosstab.
b. Use the City field for the row headings.
c. Use the State field for the column headings.
d. Use a Count of the ContactID field as the calculated value for each row and column intersection, and include row sums in the crosstab query.
e. Save the query using WestCoast_Crosstab (the default) as the name. Display the results of the query then close it.
17. Export the Companies table as an Excel file (.xlsx) with the name Companies.xlsx to the same folder as the one that stores your database. Do not export the data with formatting and layout. Save the export steps using Export-Companies as the name. Do not add a description. Save the changes to the table and close it.
18. Use the Import Spreadsheet Wizard to import the data from the Support_AC365_CT2C_AccountData.xlsx support file and append it to the Accounts table to add new account information to the database. Do not save the Import steps. Open the Accounts table, confirm it contains 34 records, then close the table.
19. Rename the WashingtonContacts query as CaliforniaContacts in the Navigation Pane so that the query name reflects the results.
20. Group the objects in the Navigation Pane by Tables and Related Views.
Save and close any open objects in your database. Compact and repair your database, close it, and then exit Access. Follow the directions on the website to submit your completed project.
