Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Excel to Access split data into tables

Posted on 2013-01-04
3
Medium Priority
?
309 Views
Last Modified: 2013-01-06
Experts,
 I recently imported an Excel spreadsheet into an Access DB table. My situation is this, I have some data columns in the table that I need to I need to separate into two other tables. I attached a picture of the table with dummy data to give you an idea. The columns Badge No and Zone need to be placed in their own tables, but make sure that badge no and the zone refers back to the correct employee in the employee table. I plan to use the both badge no and zone as primary keys. Is there any way of accomplishing this using queries??

Many thanks in advance!
sample-data.png
0
Comment
Question by:Ozxar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 2000 total points
ID: 38746078
Running these two queries ought to do it:

SELECT [Badge No] AS BadgeNo, ID AS EmpID
INTO tblBadgeNumbers
FROM EMPLOYEE

Open in new window


SELECT Zone, ID AS EmpID
INTO tblZones
FROM EMPLOYEE

Open in new window

0
 

Author Comment

by:Ozxar
ID: 38746106
Thanks! I will give it a try
0
 

Author Comment

by:Ozxar
ID: 38747647
matthewspatrick,

I ran the code and it worked fine, but I guess I worded my initial question wrong. I meant to have which zone the badge no belongs to. One badge no can only belong to one zone....but a zone can have many badge no. Could I use the same code to do this? Also, would setting up the relationships be done the same way?

Many thanks!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question