Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microsoft Access Creating Queries Expression Exercise- Criteria and Calculated Fields.

Similar presentations


Presentation on theme: "Microsoft Access Creating Queries Expression Exercise- Criteria and Calculated Fields."— Presentation transcript:

1 Microsoft Access Creating Queries Expression Exercise- Criteria and Calculated Fields

2 Using Northwind.accdb Orders Table

3 PgP MIS 202 Access Overview2-3 1. Create Expression  Locate all Ship Names that contain a “q” anywhere in the name field

4 PgP MIS 202 Access Overview2-4 Criteria  Like "*q*"

5 PgP MIS 202 Access Overview2-5 2. Create Expression  Locate all Ship Postal Codes beginning with 050

6 PgP MIS 202 Access Overview2-6 Criteria  Like “050*”

7 PgP MIS 202 Access Overview2-7 3. Create Expression  Locate all Freight charges over $100.00, sort results in Descending Order

8 PgP MIS 202 Access Overview2-8 Criteria  >100

9 PgP MIS 202 Access Overview2-9 4. Create Expression  Locate all orders Shipped between 9/1/96 and 9/30/96  Sort Ascending by Shipped Date

10 PgP MIS 202 Access Overview2-10 Criteria  Between #9/1/96# and #9/30/96#

11 PgP MIS 202 Access Overview2-11 5. Create Expression  Number of days before today an order shipped  Sort Descending

12 PgP MIS 202 Access Overview2-12 Calculated field  DaysSinceShip: Date()-[ShippedDate]

13 Using Northwind.accdb Order Details table

14 PgP MIS 202 Access Overview2-14 Create Expression  Locate all orders where Quantity is an odd number  Hint: search help (Find tab) for functions that contain the word “remainder”

15 PgP MIS 202 Access Overview2-15 Criteria  [Quantity] mod 2 <> 0

16 PgP MIS 202 Access Overview2-16 Create Calculated Field  Total discounted amount is greater than $1000.00

17 PgP MIS 202 Access Overview2-17 Calculated Field  Discounted Amount: UnitPrice * Quantity * Discount  With criteria: > 1000

18 Using Northwind.mdb Employees table

19 PgP MIS 202 Access Overview2-19 Create Calculated Field  Determine employee seniority

20 PgP MIS 202 Access Overview2-20 Calculated Field  Seniority: Date()-[hiredate]  Or  Years seniority: DateDiff("yyyy",[hiredate],Date())

21 Microsoft Access Form and Report Basics Delivering the data as required-tabular, graphical…

22 PgP MIS 202 Access Overview2-22 Forms  Used to maintain (add/delete/edit) the data in underlying tables  Finding data using Find dialog box Note available wildcard characters *, ?, [], !, -,#  Wizards-show typical layouts AutoFormat, to try different layouts quickly

23 PgP MIS 202 Access Overview2-23 Wildcard Characters

24 PgP MIS 202 Access Overview2-24 Forms and SubForms  Use to show data from related tables  Tables have one to many relationship  Example, View the many orders for one customer  Display lot of data in a small space

25 PgP MIS 202 Access Overview2-25 Forms and SubForms  Main form can have any number of subforms if you place each subform on the main form.  Can nest up to ten levels of subforms. Could have a main form that displays customers, a subform that displays orders, and another subform that displays order details

26 PgP MIS 202 Access Overview2-26 Form/SubForms Example  Open Northwind.accdb, Forms, ‘Customer Orders’

27 PgP MIS 202 Access Overview2-27 Form/SubForms Example  Form contains Customers table fields: CompanyName Country  This form is linked to subForm ‘Customer Orders Subform1’

28 PgP MIS 202 Access Overview2-28 Form/SubForms Example  Subform1 contains Orders table fields: OrderID RequiredDate  This subform is linked to subForm ‘Customer Orders Subform2’

29 PgP MIS 202 Access Overview2-29 Form/SubForms Example  Subform2 contains OrderDetailsExtended query fields: ProductName UnitPrice Quantity Discount Extended Price (a calculated field)  Note-this query is based on the tables ‘Order Details’ and ‘Products’

30 PgP MIS 202 Access Overview2-30 Form/Subform Relationships

31 PgP MIS 202 Access Overview2-31 Reports  Typically destined for printed output  Can be based on table(s) or query or SQL statement  Report Wizard can do most of the work  For the finishing touches modify in Design View

32 PgP MIS 202 Access Overview2-32 Reports and Forms- Design View  Wizards can do most of the work, but to tailor forms/reports to what you want, you must understand how to modify them in Design View  Examine property settings-similar to Visual Basic forms and controls

33 PgP MIS 202 Access Overview2-33 Report and Form Graphics  Graphics can improve appearance, but  Possible performance penalty due to way Access stores graphic images  Be aware of “Image” object “SizeMode” property settings of clip, stretch, zoom


Download ppt "Microsoft Access Creating Queries Expression Exercise- Criteria and Calculated Fields."

Similar presentations


Ads by Google