Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ms access import excel to access table

Posted on 2011-02-28
4
Medium Priority
?
251 Views
Last Modified: 2012-05-11
I get a csv file from engineering for each job batch we do.  It is in the format:

TAGS        JOB               SUFFIX        BATCH
SB207       2010-0064     2P0              802
SB208       2010-0064     2P0              802
SB210 . . . . . . . .

I have a table in my access db called TAG:

ID     BatchID    Tag    
1       1               SH219
2       1               DWC301
3       1               SB219
4       1               SG213
5 . . . . . . .

I have tables for Job, suffix and batch.  They are all linked on ID's - Suffix table has JobID, Batch table had SuffixID, Tag table has BatchID.

I need to append the tags table with non-duplicate tags from the excel file.  I linked the excel file and tried to figure out an append query.  How do I use the job, suffix and batch fields in the excel sheet to append the Tag table and have everything linked correctly.

Job -> Suffix -> Batch-> Tag

Thanks for your help.
0
Comment
Question by:johnmadigan
[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
  • 3
4 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 1500 total points
ID: 35002952
You have to do this in steps, if you want your items to be properly related. What is the relationship between the items?

For example, does a Tag belong to a Job, Suffix or Batch? Can a Tag belong to more than one Job? Can a Job have more than one Tag/Suffix/Batch?

0
 

Author Comment

by:johnmadigan
ID: 35017878
I attached a screen shot of the relationships.  One Job can have many suffix

2010-0064  000
2010-0064  1P0
2010-0064  2P0

Different jobs may use the same suffix - once a new job is started they begin the Suffix numbers

2010-0064   000
2010-0055   1P0
2010-0079   000

For each Suffix number there can be multiple batches

2010-0064  1P0  001
2010-0064  1P0  002

The batch numbers are reused as well - on each new suffix for a job the batch numbers are reset and started again from 001.  So the Batch numbers are used over again.

Then for each batch we have a set of Tags - there are no duplicate tags for a specific batch - but you may see tags repeated on other Jobs

2010-0064  1P0  001      
TAGS
102A
102B
101A

2010-0075  2P0  002
TAGS
102A
102B
101A

I have the excel file that I need to append to my Tag table.  The Job, Suffix, Batch and Tag table are related by ID's.  My excel spreadsheet does not have ID's but values. I am tying to set up a query to find the correct ID's to determine which BatchID the excel Tags need to be related to when appending the Tag table.




Relationships.doc
0
 

Author Comment

by:johnmadigan
ID: 35018974
I was able to set up a query to get me the related infromation for the excel file:

SELECT CustomerJobSummary.ID, Suffix.ID AS SuffixID, Batch.ID AS BatchID, CustomerJobSummary.OldTelnetNo, Suffix.Suffix, Batch.Batch, DrImp.TAGS
FROM DrImp, (CustomerJobSummary INNER JOIN Suffix ON CustomerJobSummary.ID = Suffix.JobID) INNER JOIN Batch ON Suffix.ID = Batch.SuffixID
WHERE (((CustomerJobSummary.OldTelnetNo)=[DrImp].[JOB]) AND ((Suffix.Suffix)=[DrImp].[SUFFIX]) AND ((Batch.Batch)=[DrImp].[BATCH]));

I end up row having the Tag from the spreadsheet and the corresponding Table ID's.

I now need to append these tags to the tag table using the BatchID - but I need to make sure that there are no existing Tag/BatchID already in the table.

Any suggestions?
0
 

Author Closing Comment

by:johnmadigan
ID: 35690757
Project was put on the shelf
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

721 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