second monthly course

63
Office Management Tools II Ms Saima Gul

Upload: dylan-williamson

Post on 31-Dec-2015

36 views

Category:

Documents


1 download

DESCRIPTION

Second monthly course. MS ACCESS. Office Management Tools II Ms Saima Gul. Displaying Selected Data with Queries. MS ACCESS. Office Management Tools II Ms Saima Gul. What is a query?. A Microsoft Access query is a question that you ask about the information stored in your Access tables. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Second monthly course

Office Management Tools II

Ms Saima Gul

Page 2: Second monthly course

Office Management Tools II

Ms Saima Gul

Page 3: Second monthly course

A Microsoft Access query is a question that you ask about the information stored in your Access tables.

Figure on slide 7 is a typical Query Design window. After you create and run a query, Microsoft Access will

retrieve and display the set of records you asked for in a datasheet. This set of records is called a dynaset, which is the set of records selected by a query.

3

Page 4: Second monthly course

Access takes the records that result from a query and displays them in a datasheet, in which the actual records are called a dynaset.

Physically, a dynaset looks like a table; in fact, it is not a table. The dynaset is a dynamic (or virtual) set of records. This dynamic set of records is not stored in the database.

When you run a query, Access places the resultant records in the dynaset. When you save the query, the information is not saved; only the structure of the query is saved—the tables, fields, sort order, record limitations, query type, and so forth.

Consider these benefits of not saving the dynaset to a physical table:

A smaller amount of space on a storage device (usually a hard disk) is needed.

The query uses updated versions of any records changed since the query was last run.

Every time the query is executed, it reads the underlying tables and re-creates the dynaset. 4

Page 5: Second monthly course

5

After you create your tables and place data in them, you are ready to work with queries. To begin a query, follow these steps:

From the Database window, click the Queries Objects button. Double click the ‘Create Query in Design View’ option.

The Show Table dialog box in the Query Design window

Page 6: Second monthly course

The Show Table dialog box displays all tables and queries in your database.

You can add the Student table to the query design with these steps:

1. Select the Student table from the Show Table dialog box.

2. Click the Add button to add the Student table to the Query Design window. Or you can double-click the table name instead of pressing the Add button.

3. Click the Close button. While in Query Design mode, you can activate the Show

Table dialog box to add more tables at any time; select Query➪Show Table or click the Show Table button (picture of table with plus sign).

When you want to delete a table from the Table/Query pane (top pane of the Query Design window), click the table name in the query/table entry pane and either click Delete or select Query➪Remove Table.

6

Page 7: Second monthly course

7

Page 8: Second monthly course

The Query window has two main views, the Design View and the Datasheet View.

The Design View is where you create the query, and the Datasheet View is where you display the query’s dynaset.

The Query Design window is currently in the Design View; it consists of two panes:

1. The table entry pane

2. The Query by Example (QBE) design pane (also called the QBE grid)

The table/query entry pane, the upper pane, is where tables and/or queries and their design structures are displayed.

The visual representation of the table is a small window inside the table/query entry pane. It shows the table name in the title bar of this small window and displays all the fields in the list box of the window.

The Query by Example (QBE) pane, the lower pane, is used for holding the field names that will be displayed and any criteria that will be used by the query.

Each column in the QBE design pane contains information about a single field from a table or query in the upper pane. 8

Page 9: Second monthly course

The Query Design pane (QBE grid), which has six named rows:

Field. This row is where field names are entered or added.

Table. This row shows the table the field is from (useful in queries with multiple tables).

Sort. This row enables you to enter sort directives for the query.

Show. This check box determines whether to display the field in the resulting dynaset.

Criteria. This row is where you enter the first line of criteria to limit the record selection.

Or. This row is the first of a number of rows to which you can add multiple values to be used in criteria selection.

9

Page 10: Second monthly course

You can add a single field in several ways. One method is to double-click the field name in the field list

(also called a table window); the field name will immediately appear in the first available column in the QEB pane.

You can also add a field graphically to the QEB pane. Highlight the field name in the table window in the table entry pane, click it, drag it, and drop it in the desired column of the QBE Design pane.

Another method is to select the field you want from the drop-down list that appears when you click the down arrow button in the Field: cell of the QBE pane.

To run the query, click the Datasheet button on the toolbar (the first icon from the left). When you are finished, click the Design button on the toolbar (the first one on the left) to return to design mode.

You can also run the query by clicking the Run icon on your toolbar with the exclamation point on it, or by selecting Query➪Run.

10

Page 11: Second monthly course

11

Page 12: Second monthly course

You can add more than one field at a time by selecting the fields you want to place in the query and then dragging and dropping the selection in the QBE pane. The selected fields do not have to be contiguous (one after the other).

To add multiple fields, follow these steps:

1. Remove any existing fields in the QBE pane by selecting Edit➪Clear Grid from the menu.

2. Highlight in the table entry pane the first field name that you want to add.

3. Hold the Shift/Control key down and click the other fields that you want to select.

4. Click the selected fields and drag the Multiple Field icon, which appears as you move the mouse. The icon appears as a group of three field icons.

5. Drop the Multiple Field icon in the desired column of the QBE Design pane. 12

Page 13: Second monthly course

To select all the fields of a table, perform these steps:

1. Remove any existing fields in the QBE pane by selecting Edit➪Clear Grid from the menu.

2. Double-click the title bar of the table to select all the fields.

3. Point to any of the selected fields with the mouse.

4. Drag the Multiple Field icon to the QBE pane. This method fills in each column of the QBE pane

automatically. All the fields are added to the QBE pane from left to right, based on their field order in the Student table.

You can also select all the fields by clicking on the * in the table window in the table entry pane. The QBE shows ‘table name.*’ which means that all fields have been selected.

13

Page 14: Second monthly course

14

Page 15: Second monthly course

You can remove a field from the QBE Design pane. Select the field or fields to be deleted in the QBE Design

pane, and then press Delete or select Edit➪Delete.

15

To make the query datasheet easier to read, you can rename the fields in your query. The new names become the tag headings in the datasheet of the query.

To rename pId to Program ID, follow these steps: Click to the left of the ‘p’ of pId in the Field: row of the

QBE Design pane. Type Program ID and a colon (:) between the new name

and the old field name.

Page 16: Second monthly course

16

Field: name address DoB Program ID:pId

Table: basic info basic info basic info basic info

Sort:

Show:

Criteria: >=#1/1/1990# 3

Or: >=#1/1/1990# 4

basic info

*stIdnameaddressphoneDoBPhotopId

Table entry pane

QBE pane

Page 17: Second monthly course

Record criteria are simply some rule or rules that you supply for Access to follow.

These criteria tell Access which records you want to look at in the dynaset.

A typical criterion could be “all Students,” or “only those students not living in Peshawar,” or “students enrolled in program having ID 4.”

In other words, with record criteria, you create limiting filters to tell Access which records to find and which to leave out of the dynaset.

You specify criteria starting in the Criteria: property row of the QBE pane. Here you designate criteria with an expression. The expression can be simple example data or can take the form of complex expressions using predefined functions.

17

Page 18: Second monthly course

As an example of a simple data criterion using the Student table, you could type “Peshawar” in the Criteria: cell of Address and the datasheet displays only records for Peshawar.

18

Result of query

Page 19: Second monthly course

You can also specify criteria for Numeric, Date, and Yes/No fields. Simply enter the example data in the criteria field.

It is also possible to add more than one criteria to a query. For example, suppose that you want to look only at records from the Student table for students who are enrolled both in Pid 3 and 4, and where these students have DoB in year 1990 (where the value of DoB is greater or equal to January 1, 1990).

1. Create a new query starting with the Student table.

2. Add the fields name, address, Pid, and DoB to the QBE grid.

3. Click the Criteria: cell in the Pid column in the QBE Design pane. Type 3 here.

4. Click the Or: cell in the Pid column in the QBE Design pane. Type 4 here.

5. Click the Criteria: cell in the DoB column in the QBE Design pane. Type >= 01/01/1990 in the cell. (also in or cell)

6. Click the Datasheet button. 19

Page 20: Second monthly course

20

Field: name address DoB pId

Table: basic info basic info basic info basic info

Sort:

Show:

Criteria: >=#1/1/1990# 3

Or: >=#1/1/1990# 4

basic info

*stIdnameaddressphoneDoBPhotopId

Page 21: Second monthly course

21

Page 22: Second monthly course

After you create the tables for your database and decide how the tables are related to one another, you are ready to begin creating multiple-table queries to obtain information from several tables at the same time.

In the query design view, click on the ‘show table’ button on the tool bar to add more tables to the table/query entry pane.

Next slide shows the top pane of the Query Design window with additional tables added. Because the relationships were set at table level, the join lines are automatically added to the query.

22

Page 23: Second monthly course

23

Page 24: Second monthly course

To view data in two tables, they must be joined through a link that is established via a common field (or group of fields) between the two tables.

The method of linking the tables is known as joining. In a query, tables with established relationships are

shown already joined. Within a query, you can create new joins or change

existing joins; just as there are different types of relationships, there are different types of joins.

The different types of joins are: Equi-joins (inner joins) Outer joins Self-joins

24

Page 25: Second monthly course

The default join in Access is known as an inner join or equi-join.

It tells Access to select all records from both tables that have the same value in the fields that are joined.

Thus, an inner join between tables is simply a join where records are selected when matching values exist in the joined field of both tables.

Unlike inner joins (equi-joins), outer joins are used for showing all records in one table while showing common records in the other.

The table or query that does not have a matching record will simply display empty cells in the datasheet when the dynaset is displayed.

25

Page 26: Second monthly course

26

Page 27: Second monthly course

27

Page 28: Second monthly course

28

Page 29: Second monthly course

29

Page 30: Second monthly course

30

Page 31: Second monthly course

31

Page 32: Second monthly course

32

Field: stId name Metric Marks Obtained Marks Percentage: [Obtained Marks]/[Metric Marks]*100

Table: basic info basic info basic info basic info

Sort:

Show:

Criteria:

Or:

basic info

*stIdname...

Page 33: Second monthly course

33

Page 34: Second monthly course

34

In the following slides, only the QBE section is shown for the ‘basic info’ table added in the table entry pane.

Field: name address pId DoB

Table: basic info basic info basic info basic info

Sort:

Show:

Criteria: >=#1/1/1990#

Or:

Page 35: Second monthly course

35

It also has a negated version in which we write ‘Not In(‘Peshawar’, ‘Kohat’), which works the opposite.

Field: name address pId DoB

Table: basic info basic info basic info basic info

Sort:

Show:

Criteria: In(‘Peshawar’, ‘Kohat’)

Or:

Page 36: Second monthly course

36

There are three special pattern matching symbols: ? – A single character (0-9, Aa-Zz) * - Any number of characters (0 to n) # - Any single digit (0 – 9) For example: Address LIKE ‘P*’ means the first character must be P,

but the rest of the string can be anything. Address LIKE ‘S???’ means that there must be exactly 4

characters in the string, the first of which must be an S. Address LIKE ‘*r’ means any sequence of characters, of

length at least 1, with the last character an r. Address LIKE ‘*sh*’ means a sequence of characters of

any length containing sh. Address NOT LIKE ‘P*’ means the first character cannot

be a P.

Page 37: Second monthly course

37

It also has a negated version in which we write ‘Not Like P*’ which works the opposite.

Field: name address pId DoB

Table: basic info basic info basic info basic info

Sort:

Show:

Criteria: Not Like “a???” Like “P*”

Or:

Page 38: Second monthly course

There are five aggregate functions:

COUNT returns number of values in specified column.

SUM returns sum of values in specified column.

AVG returns average of values in specified column.

MIN returns smallest value in specified column.

MAX returns largest value in specified column.

Each operates on a single column of a table and returns a single value.

COUNT, MIN, and MAX apply to numeric and non-numeric fields, but SUM and AVG may be used on numeric fields only.

Examples: You just need to write following in the first column of QBE pane.

Count Result: count([pId])

Sum Result: sum([Salary])

Avg Result: avg([Salary])

Min Result: min([Obtained Marks])

Max result: max([Obtained Marks])38

Page 39: Second monthly course

Office Management Tools II

Ms Saima Gul

Page 40: Second monthly course

A Project is a job that has a beginning and an end (time), a specified outcome ( scope) at a stated level of quality (performance), and a budget (cost).

A project is a temporary effort to create a unique product or service. Projects usually include constraints and risks regarding cost, schedule or performance outcome.

40

Project management is a set of principles, practices, and techniques applied to lead project teams and control project schedule, cost, and performance risks to result in delighted customers.

Efficient use of resources to complete a project as designed, on time, at the desired level of performance, and within budget.

These project parameters are also called constraints. Examples of different kinds of projects are: Design and construction of new building Working on Final Year Project Developing a new product or service etc.

Page 41: Second monthly course

When you open Microsoft Project from the Programs folder of the Windows Start menu, Project initially displays the main screen for Project 2007, as shown on next slide.

On the left, you see the Project Guide pane. The Project Guide pane helps users set up and work with a project.

You also can open Project by double-clicking any Project file. Project files are saved with the extension .mpp.

41

Page 42: Second monthly course

42

Page 43: Second monthly course

The Project Guide is a goal-based user interface that helps you build projects.

In addition to the Project Guide pane on the left side of the screen, you also can display the Project Guide toolbar, which appears just above the Project Guide pane.

To display the Project Guide toolbar, right-click anywhere in the toolbar area at the top of the screen and choose Project Guide (or Tools -> Options -> Interface Tab) (see next slide).

Using the buttons on the Project Guide toolbar, you can limit the choices that appear in the Project Guide pane.

At this point, you can use the Project Guide toolbar and the Project Guide pane to begin building your project.

Click a button on the Project Guide toolbar to start working in the associated area.

The choices listed in the Project Guide pane change, based on the Project Guide toolbar button that you click.

43

Page 44: Second monthly course

44

Page 45: Second monthly course

When you click a link in the Project Guide, a wizard starts and walks you through the process that’s suggested by the link.

For example, if you click the Tasks button on the Project Guide toolbar and then click the Define the project link, a three-step wizard walks you through starting a project.

The first step helps you to establish the starting date for your project. After setting the date, click the right arrow at the top of the pane or click Save and go to Step 2 at the bottom of the Project Guide pane to continue.

In Step 2 of the Define the Project Wizard, you identify whether you intend to use Project Server.

In Step 3, you return to the Project Guide.

45

Page 46: Second monthly course

By default, Project opens a new project in the Gantt Chart view. The Gantt Chart view has two main sections: the Gantt table

and the Gantt Chart. After you enter task information, the Gantt table (in the left

pane) holds columns of information about your project, such as the task name, duration, start date, and more.

The Gantt Chart (in the right pane) is a graphic representation that helps you see the timing and relationships among tasks.

The timescale along the top of the Gantt Chart acts like a horizontal calendar. Project enables you to display up to three timescales along the top of the Gantt Chart—a top, middle, and bottom timescale (Format->time scale).

On the next slide, you see two timescales. The top timescale shows months; the bottom timescale shows weeks.

Multiple timescales help you to see the multiple levels of timing simultaneously, such as the day and hour or the month, week, and day.

46

Page 47: Second monthly course

Several views or portions of views in Project, such as the Gantt table, use a familiar spreadsheet style interface. Information appears in columns and rows. The intersection of a column and a row is a cell, just as in Excel.

Project assigns each task in your project an ID number, which corresponds to the task’s row number running along the left of the spreadsheet.

You can enter project information either in dialog boxes or directly into cells.

When you select a cell, the Entry bar, which appears immediately above the column names of the table, displays the information in the cell.

47

Page 48: Second monthly course

When you start working on a project, first, you must understand the overall goal and scope of the project so that you can clearly see the steps that lie between you and that goal.

Don’t worry about the order of the tasks at this point—just brainstorm all the major areas of activity.

Suppose that you’ve been given the project of organizing an annual meeting for your company. You may take the following steps:

Book the meeting space Schedule speakers Arrange for audiovisual equipment Order food Send out invitations Mail out annual reports

48

Page 49: Second monthly course

After you have prepared a list of major tasks, break them into more detailed tasks.

Take one of the items on the list—Order food, for example—and consider how you can break down this task. How detailed should you get?

The following is one possible breakdown of the Order food task:

Create a budget. Determine a menu. Select a caterer.

Send out requests for bids. Receive all estimates. Review estimates and award contract.

Give final head count to caterer. Confirm menu one week before the meeting

49

Page 50: Second monthly course

After you have an idea of the tasks that are involved in your project, you need to have some idea of the timing of these tasks.

Should you allow two weeks for caterers to reply with bids? Not if you have only three weeks to organize the meeting.

You may want to approach determining task timing by building an initial schedule in Project, assigning time to tasks, and seeing how close you can come to your deadline. If you’re way off, you can go back and tweak the timing for individual tasks until your schedule works.

50

Before you can build a Project schedule, you need to know what resources are available to you, as well as their costs.

You don’t necessarily need to know these resources by name, but you should know, for example, that your construction project needs three engineers at a cost of $75 per hour and one piece of earthmoving equipment at a daily rental cost of $450.

You need to identify these resources and assign them to individual tasks early in the project-planning process.

Page 51: Second monthly course

Finally, before you enter project information into a schedule, be aware of relationships among tasks.

Does the CEO have to approve the menu before you book the caterers? Are you required to wait three weeks after applying for a permit before starting construction on a building?

If your project faces issues involving the order and relationships of tasks, you will save yourself some headaches down the line and build a more realistic schedule if you can identify these obstacles now.

51

Page 52: Second monthly course

52

Page 53: Second monthly course

To begin building a project, enter the major steps to reach your goal in roughly the same order that you expect them to occur.

For the sample project (organizing a corporate annual meeting), follow these steps to create your first task—booking the meeting space:

1. Click the Task Name column in the first row of the Gantt table.

2. Type Book Meeting Space. The text appears in the cell and in the entry bar that is above the Gantt table.

3. Press Enter to accept the text. Information begins to appear in your schedule. Project lists the task name in the Task Name column and

makes a corresponding entry in the Duration column. The question mark in the Duration column represents an

estimated duration. According to the Start column, the task begins today, and a taskbar reflects the one-day duration of the task graphically. And, as you work, Project highlights any change you make that affects the schedule.

53

Page 54: Second monthly course

54

Page 55: Second monthly course

When you add subtasks, the upper-level task becomes a summary task.

By default, summary tasks appear in boldface type and subtasks appear in normal type.

Begin by adding subtasks under the Book meeting space task. Follow these steps to insert a new task:

1. Click the Schedule Speakers task.

2. Choose Insert ➪ New Task. You get a blank row. Type here Request purchase order and press enter.

3. Click the Indent button on the Formatting toolbar to indent the subtask, as shown on next slide.

Notice that the summary task (Book meeting space) now displays a black bar on the Gantt Chart, with a down arrow shape marking its beginning and end.

When a task becomes a summary task (that is, when it contains subtasks), the timing of the summary task reflects the total amount of time that is required to complete its subtasks.

If a task has a duration assigned to it and you make it into a summary task, the timing of the subtasks overrides the assigned duration.

55

Page 56: Second monthly course

56

Page 57: Second monthly course

By default, Project uses the Standard calendar, also called the base calendar because it serves as the basis for the calendar scheduling calculations Project makes.

You can create a Standard calendar for each group of resources in your project.

For example, if the plant employees work a nine-hour day from 6:00 a.m. to 3:00 p.m., and the office employees work an eight-hour day from 8:00 a.m. to 5:00 p.m., you can create two calendars. When you assign one day of an office employee’s time, Project understands it to be an eight-hour day.

You can change your calendar, designating whether you want your project to use a standard, 24-hour, or night-shift calendar for most of your work assignments.

57

Page 58: Second monthly course

Project makes default assumptions about certain items that form the basis of the default project calendar.

For example, Project assumes that the default week contains five working days and 40 working hours. Project uses this calendar for resources unless you assign a different calendar to them. You can see the assumptions that Project uses on the Calendar tab of the Options dialog box.

The Calendar tab of the Options dialog box does not affect scheduling. The options that you see in this dialog box show you the defaults that Project uses to convert durations into corresponding time amounts. For example, if you enter 1mo for a task’s duration, Project assumes that you are allotting one month (which is equal to 20 days) for that task.

To view the default calendar options, choose Tools ➪ Options. Click the Calendar tab in the Options dialog box.

58

Page 59: Second monthly course

59

Page 60: Second monthly course

You can select any day of the week as your start day. If your company uses a fiscal year other than the

calendar year (January through December), you may want to set the Fiscal Year Starts In option. This setting is especially useful when you generate reports that show costs per quarter or year.

The final five settings on the Calendar tab of the Options dialog box enable you to designate specific start and end times for each day, the number of hours in a day and in a week, and the number of days in a month. For example, you can set the work day to start at 9:00 a.m. and end at 6:00 p.m., assign 9 hours to your work day, and end up with a 45-hour week.

60

Page 61: Second monthly course

You also can modify the way in which Project enters task information.

In the Options dialog box (Tools ➪ Options), click the Schedule tab to change the default settings for entering tasks, as shown on next slide. On this tab, you determine the default unit of time for entering task durations (the default is days), work time (hours), and whether new tasks start on the project start date or the current date.

For example, if you are working on a five-year project in which most tasks run for months—not days—you may want to change the default setting for the Duration Is Entered In field.

If you prefer to have any new tasks begin no earlier than the current date, you can adjust the setting for New tasks.

When you are satisfied with the settings on the Schedule tab, click OK to close the Options dialog box

61

Page 62: Second monthly course

62

Page 63: Second monthly course

63