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
Solved

ms access import excel to access table

Posted on 2011-02-28
4
245 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
  • 3
4 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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…

856 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