Databases

2
Databases Field Names 1. Make sure that you have opened the file first in Excel and made any changes, if required, to the field names 2. If you have made changes, save the file as a CSV again. If you haven’t made changes, then just close the file Naming the database 1. Open Access 2. Give the new database a file name (usually the same as the CSV filename) and then use the yellow folder to select your user area 3. Click on Create Importing the CSV 1. External data > Text file (make sure that you are importing, not exporting 2. Browse to the file location 3. Select import the source data > Next 4. Choose “first row contains field names” > Next 5. Choose advanced and then change any data types as required 6. Add a Primary key if a “unique” field doesn’t already exist 7. Go back to design view and make any further changes such as currency or yes / no 8. Remember to screen print the data types as well as any field properties you have changed. Queries 1. Once you have read the task put a mark next to each bullet to show if it is part of the report or part of the query 2. Now do the query element first 3. Create > Query Wizard > Simple Query Wizard 4. Check the table is selected (or other query if appropriate) 5. Choose all the fields 6. Change the name of the query 7. Modify the design How to enter queries 1. When a field contains something (e.g. alloy wheels or 2012) a. Like *alloy wheels* finds alloy wheels anywhere b. Like *2012 finds 2012 with anything before it 2. When you want all the records apart from something a. NOT Ford (returns all the records apart from Ford) 3. When you want all the records equal to or above a value a. >=4125 (returns all records equal to or greater than 4125)

description

Brief help on using MS Access

Transcript of Databases

Databases

Field Names

1. Make sure that you have opened the file first in Excel and made any changes, if required, to

the field names

2. If you have made changes, save the file as a CSV again. If you haven’t made changes, then

just close the file

Naming the database

1. Open Access

2. Give the new database a file name (usually the

same as the CSV filename) and then use the yellow

folder to select your user area

3. Click on Create

Importing the CSV

1. External data > Text file (make sure that you are importing, not exporting

2. Browse to the file location

3. Select import the source data > Next

4. Choose “first row contains field names” > Next

5. Choose advanced and then change any data types as required

6. Add a Primary key if a “unique” field doesn’t already exist

7. Go back to design view and make any further changes such as currency or yes / no

8. Remember to screen print the data types as well as any field properties you have changed.

Queries

1. Once you have read the task put a mark next to each bullet to show if it is part of the report

or part of the query

2. Now do the query element first

3. Create > Query Wizard > Simple Query Wizard

4. Check the table is selected (or other query if appropriate)

5. Choose all the fields

6. Change the name of the query

7. Modify the design

How to enter queries

1. When a field contains something (e.g. alloy wheels or 2012)

a. Like *alloy wheels* finds alloy wheels anywhere

b. Like *2012 finds 2012 with anything before it

2. When you want all the records apart from something

a. NOT Ford (returns all the records apart from Ford)

3. When you want all the records equal to or above a value

a. >=4125 (returns all records equal to or greater than 4125)

New Fields in a query

1. Find the first blank column

2. Type in the name of your new field immediately followed by a colon:

3. Make sure the ‘show’ tick box is ticked

4. Now type in any calculation, indicating field names with square brackets

a. Profit:[SalesPrice]-[PurchasePrice]

i. This creates a new field called Profit which is calculated by taking the

Purchase Price field away from the Sales Price field

b. VAT:[SalesPrice]*0.2

i. Creates a new field called VAT which is calculated by finding 20% (i.e. 0.2) of

the SalesPrice

c. Final Price:[Purchase Price]*1.1

i. Creates a new field called Final Price which is the Purchase Price + 10% (i.e.

multiplies it by 1.1)

Saving the query

1. Once you have completed your query, run it and manually check some of the records

2. Double check that it has a sensible query name

Creating the reports / labels

1. Click once on the query name

2. Create > Report Wizard / create > labels

3. Double check the correct query is selected

4. Select the fields required in the task (remember for labels you will probably need to type in

the labels as well as moving the fields into the label)

5. Ignore grouping levels

6. Do any sorts as required by the task

7. Choose tabular for your layout > also check if portrait or landscape is required

8. Change the report name to something appropriate

9. Preview the report to see how the field sizes need modifying

Formatting the report

1. Go to design view

2. Resize the fields so that everything is visible and one page wide

a. Double check this as lots of marks are easily lost

3. Enter the footer or header as a report footer or header

a. It is only a page footer or header if specifically requested

4. Enter the title as requested

5. Labels are for entering text

6. Text boxes are for entering formula

Entering formula

1. =COUNT([FieldName]) will count the number of records

2. =SUM([FieldName]) will add up the contents of the chosen field

3. Remember to change the properties to currency, etc if required.