How to Concatenate Cells in Microsoft Access



Similar documents
How to Import Data into Microsoft Access

Introduction to Microsoft Access 2003

Lab 9 Access PreLab Copy the prelab folder, Lab09 PreLab9_Access_intro

Google Sites. How to create a site using Google Sites

Step Sheet: Creating a Data Table and Charts

APPLYING BENFORD'S LAW This PDF contains step-by-step instructions on how to apply Benford's law using Microsoft Excel, which is commonly used by

Creating forms in Microsoft Access 2007

Microsoft Access Creating Filters and Tables

Merging Labels, Letters, and Envelopes Word 2013

Sample Table. Columns. Column 1 Column 2 Column 3 Row 1 Cell 1 Cell 2 Cell 3 Row 2 Cell 4 Cell 5 Cell 6 Row 3 Cell 7 Cell 8 Cell 9.

Lesson 07: MS ACCESS - Handout. Introduction to database (30 mins)

Instructions for creating a data entry form in Microsoft Excel

Microsoft Access 2010 Part 1: Introduction to Access

Microsoft Access Rollup Procedure for Microsoft Office Click on Blank Database and name it something appropriate.

Using VLOOKUP to Combine Data in Microsoft Excel

Excel basics. Before you begin. What you'll learn. Requirements. Estimated time to complete:

The LMS/Moodle 2.7 GradeBook Workbook

Microsoft Access 3: Understanding and Creating Queries

MicroStrategy Desktop

How to use Microsoft Access to extract data from the 2010 Census P.L Summary Files

Introduction to Microsoft Access 2010

Downloading RIT Account Analysis Reports into Excel

What is Microsoft Excel?

Excel Templates. & Quote/Invoice Maker for ACT! Another efficient and affordable ACT! Add-On by V

Mail Merge Creating Mailing Labels 3/23/2011

Creating tables in Microsoft Access 2007

Introduction to Microsoft Access 2013

Word 2010: Mail Merge to with Attachments

Microsoft PowerPoint 2010 Handout

Instructions for applying data validation(s) to data fields in Microsoft Excel

Creating and Using Forms in SharePoint

Introduction to Word 2007

Lab 2: MS ACCESS Tables

Navigating Microsoft Word 2007

Migrating to Excel 2010 from Excel Excel - Microsoft Office 1 of 1

Click to create a query in Design View. and click the Query Design button in the Queries group to create a new table in Design View.

Internet Explorer 7. Getting Started The Internet Explorer Window. Tabs NEW! Working with the Tab Row. Microsoft QUICK Source

Importing from Tab-Delimited Files

Creating a Newsletter with Microsoft Word

To export data formatted for Avery labels -

Introduction to Microsoft Access 2007

ACCESS Importing and Exporting Data Files. Information Technology. MS Access 2007 Users Guide. IT Training & Development (818)

Excel Reports and Macros

Excel Tutorial. Bio 150B Excel Tutorial 1

SharePoint Wiki Redirect Installation Instruction

Using Mail Merge in Microsoft Word 2003

Microsoft Excel Introduction to Microsoft Excel 2007

Entering the example employee satisfaction survey in Survey Crafter Professional s Survey Designer window

warpct.com Working with MS Excel 2003 Workbook courseware by WARP! Computer Training

Mail Merge (Microsoft Office 2010)

MICROSOFT ACCESS 2003 TUTORIAL

Microsoft Excel 2010 Part 3: Advanced Excel

Customizing forms and writing QuickBooks Letters

Advanced Excel 10/20/2011 1

HOW TO BURN A CD/DVD IN WINDOWS XP. Data Projects

Microsoft Access 2010 Overview of Basics

Qualtrics Survey Tool

Automate tasks with Visual Basic macros

Microsoft Office 2010: Introductory Q&As PowerPoint Chapter 1

Crystal Reports Payroll Exercise

Microsoft Excel 2010 Tutorial

Creating a Database in Access

Introduction To Microsoft Office PowerPoint Bob Booth July 2008 AP-PPT5

Microsoft Access 2010 handout

Styles, Tables of Contents, and Tables of Authorities in Microsoft Word 2010

In this session, we will explain some of the basics of word processing. 1. Start Microsoft Word 11. Edit the Document cut & move

Microsoft Office. Mail Merge in Microsoft Word

DOING MORE WITH WORD: MICROSOFT OFFICE 2010

In this example, Mrs. Smith is looking to create graphs that represent the ethnic diversity of the 24 students in her 4 th grade class.

Access Tutorial 1 Creating a Database

Use signatures in Outlook 2010

Intro to Excel spreadsheets

Access Queries (Office 2003)

Using Microsoft Project 2000

Microsoft Excel Understanding the Basics

Accounts Receivable: Importing Remittance Data

Microsoft Access 2000

Microsoft Access Basics

Introduction to Microsoft Excel 2010

Chapter 9 Creating Reports in Excel

Using Word 2007 For Mail Merge

Using the SAS Enterprise Guide (Version 4.2)

Tutorial 3 Maintaining and Querying a Database

Getting Started Guide

Create Database Tables 2

BID2WIN Workshop. Advanced Report Writing

Microsoft Office 2010

Microsoft Excel 2013: Using a Data Entry Form

Access Tutorial 3 Maintaining and Querying a Database. Microsoft Office 2013 Enhanced

Search help. More on Office.com: images templates

How to Download Census Data from American Factfinder and Display it in ArcMap

GIS I Business Exr02 (av 9-10) - Expand Market Share (v3b, Jul 2013)

Contents. Launching FrontPage Working with the FrontPage Interface... 3 View Options... 4 The Folders List... 5 The Page View Frame...

Microsoft Access XP Session 1 Week 8

The very basic basics of PowerPoint XP

To launch the Microsoft Excel program, locate the Microsoft Excel icon, and double click.

Transcription:

How to Concatenate Cells in Microsoft Access This tutorial demonstrates how to concatenate cells in Microsoft Access. Sometimes data distributed over multiple columns is more efficient to use when combined into one column. For example, when downloading Census data from the American Factfinder website, number codes used to identify geographic entities such as state, county, and census tract may be presented in separate columns. In order to join this table to another table or boundary file, you may need to combine the columns in the data table so that they match the ID column in the other table or file (which would then allow you to join the two). The example below in Figure 1 is a table called GeogTract stored within an Access geodatabase: Figure 1 Notice how the state, county, and tract codes are stored in different columns. In this tutorial, we will combine these three columns into one. Unlike Excel, which allows you to insert a new, calculated column directly into a spreadsheet, in Access we must use the query builder to create a whole new table that will include our calculated field. This may sound daunting, but it is actually quite easy to do. Queries are specific views that we create for tables. We can create several different kinds of queries that can: display certain records in a table based on some criteria, create summary columns, aggregate data, average data, and bring data from two or more tables together into one view. In this example, we will create a query that will combine, or concatenate, several columns into one. Building The Concatenation Query The first step is to close the table, and move from the Table Objects view (which lists all of the tables in the database) to the Query Objects view, by clicking Queries in the menu on the left (see Figure 2). Since we have not built any queries, there will not be any listed in the objects window. Click on Create Query in the Design view to enter the query builder window. UW Libraries July 2007 1

Figure 2 The first question we will be asked is: what tables do you want to add to the query (Figure 3)? Scroll through the list of tables and select the relevant one in this case, we select the GeogTracts table - click Add, and then click Close. Figure 3 Once we make our selection, we are presented with the query design view window. At the top left is the GeogTracts table that we added, with a list of all the fields (columns) in the table. At the bottom of the window is a series of blank boxes that represents the fields from the table that we want to add to the query (see Figure 4). At this point, they are blank. UW Libraries July 2007 2

Figure 4 So the next step is to add all of the fields from GeogTracts to the query. Select the first field name in the table by left clicking on it, scroll to the bottom of the field list and, and while holding down the shift key select the last field name in the list. This should select all of the fields in the list. Then hold down the left mouse button, drag the field names down to the first empty box, and release the button. This will add all of the fields from the table to the query. When we are finished, the window should look like Figure 5: Figure 5 UW Libraries July 2007 3

At this point, our query contains all of the fields that are present in the GeogTracts table. The next step is to create the new, concatenated column. Scroll to the end of the list of query fields, to the first available, empty box. Click in the first row (the Field row) of the first empty box, so that a blinking cursor appears. Then, go to the tool bar menu and click the Magic Wand. This will launch the expression builder, which consists of four windows: a top window where you type in the expression, a lower-left window that lists all of your tables, a lower-middle window that lists all of the fields within the table that is selected in the lower-left window, and a lower-right value window, which you can ignore. The expression window, with the code you need to concatenate the columns, looks like Figure 6: Figure 6 In the first part of the expression, you create a name for the new column that you are going to create. In this case, we create the name NEW_ID. We separate the name of the field from the actual expression with a colon. After the colon is a list of all of the fields that we want to combine, with the name of the field in square brackets. You can type in the field names or select them from the list (if you select them from the list, Access will add a placeholder for an expression name and the name of the table - make sure to delete the extra names and characters that it inserts). Then separate each field name with an ampersand, two quotes, and an ampersand & &. This is the syntax that tells Access to concatenate these columns. The final expression should be: NEW_ID: [STATE] & & [COUNTY] & & [TRACT] Click OK when you are finished, and the new calculated field will be added to our query in the design view. We can preview the query by hitting the toggle button in the upper-left hand corner of the tool bar (the button has a little table on it). Scroll to the far left, and you will see the new concatenated ID column (see Figure 7). UW Libraries July 2007 4

Figure 7 Creating a New Table with the Concatenated Field At this point, we have a query that has all of our data from the GeogTracts table, plus our new concatenated field. But we are not finished yet. At this point, we only have a query. The query itself contains no actual data: it is simply a set of commands that displays data from our table based on our instructions. The next step is to take this query and turn it into a table. Hit the toggle button in the upper-left hand corner of the tool bar (the button has a little triangle and pencil on it) to return to the query design view. On the tool bar, select the query drop down menu (the button has two tables on it) and select the Make-Table Query option (Figure 8). Figure 8 UW Libraries July 2007 5

You will be presented with the Make Table window, which prompts you to create a name for the table you want to create (Figure 9). Save the table in the current database. Click OK. Figure 9 Once you have done this, close the query window. You will be asked whether you would like to save this query. Say yes, and accept the default name, Query1. Then you will be back at the query objects window, and you will see one object: Query1 (Figure 10). Figure 10 At this stage, we have created a Make-Table query that will: take all of the fields from the GeogTract table, add a concatenated ID number field, and will turn this into a new table called GeogTractNew. The last step is to actually run this query to make the new table. Double-click on the query to run it. Access will present you with some warning messages that you are about to create a new table. Click OK to get through both of the messages, and Access will run the query. It may take some time, depending on how large the data table is. Once it is finished, click on Tables in the objects menu, and scroll through the list of tables. You should see the new table, in this case, GeogTractNew,in the list (Figure 11). When you open it, it will look exactly like the query you assembled: it will have all of the fields from the original table, plus the new concatenated ID field. UW Libraries July 2007 6

Figure 11 You now have a brand new table with the new ID column At this point, you may want to consider deleting the original table, if it is no longer useful. More importantly, you might want to delete the make-table query. If you were to click on the make-table query again to run it, the GeogTractNew table would be completely overwritten, and any changes that you made after creating the table would be lost. UW Libraries July 2007 7