Shipping Efficiency Query
You will create a query to calculate the number of days between the date an order was placed and the date the order was shipped for each order. The result of your work will be a list of orders that took more than 30 days to ship. The salespeople will be required to review the records and report the source of the delay for each order. The CEO feels there may be issues with one of the shipping companies, and would like data to back that up.
- a.Create a query using Query Design. From the Customers table, include the fields CompanyName, ContactName, ContactTitle, and Phone. From the Orders table, include the fields OrderID, OrderDate, and ShippedDate.
- b.Run the query and examine the records. Save the query as Shipping Efficiency.
- c.Add a calculated field named DaysToShip to calculate the number of days taken to fill each order. (Hint: The expression will include the OrderDate and the ShippedDate; the results will not contain negative numbers.)
- d.Run the query and examine the results. Does the data in the DaysToShip field look accurate? Save the query.
- e.Add criteria to limit the query results to include only orders that took more than 30 days to ship.
- f.Add the Quantity field from the Order Details table and the ProductName field from the Products table to the query. Sort the query by ascending OrderID. When the sales reps contact these customers, these two fields will provide useful information about the orders.
- g.Add the caption Days to Ship to the DaysToShip field. Switch to Datasheet view to view the results. Adjust column widths as necessary.
- h.Save and close the query.