INSERT INTO Issue

  • Onderwerp starter Onderwerp starter DKM
  • Startdatum Startdatum
Status
Niet open voor verdere reacties.

DKM

Gebruiker
Lid geworden
16 jan 2012
Berichten
5
I need to insert an excel sheet in access and retransform it into a star scheme.
However I am having some difficulty with the SQL code to do so!

So far I have managed to set up this SQL code:

"INSERT INTO [Master Table E2E] ( ProductID )
SELECT [Product].ID
FROM [Master Table E2E] INNER JOIN Product ON [Master Table E2E].Product = Product.Product_name;"

this adds the lines underneath my table in stead of in my table

What is the error in the code?

Is there an easier way?

Thanks!!!
 
Laatst bewerkt:
If you want a quick solution, you should be more clear in your question ;) BTW: there's no need to qualify your question as Urgent; anyone who asks a question wants (and gets) an answer...

this adds the lines underneath my table in stead of in my table
So what happens here?
 
Ok, thanks, I'am a newbe at this I'm afraid...

Well, the idea is to decompose the original excel file in a star scheme in access. This first example I created a table product with a product ID, ea and now I would like to transform the product column in the fact table from the product name to only the ID, with all the relevant information regarding the product in the product table. Furthermore I would like to do the same for the other dimensions.

So what happens here?

I tried to do this using an SQL query (see first message), however the query adds the ID in the rows underneath the 'actual' table instead of in the table.

I hope this is clear enough...

thank you for the quick respons!!

DKM
 
Why do you mean by 'transform'? Normally, if you import an Excel sheet, your data should have the format of an Access table, with rows and columns. Importing the import table in another table isn't going to change that layout. It would help if you could post an example (excel sheet + db).
 
well by transform I mean that the excel file has columns with the dimensions. The purpose would be to create seperate tables for the dimensions and link these with the fact table thus only use ID's for the dimensions in the fact table and more info in the linked dimension tables.

Not sure I can upload the file since it holds real company info...
 
I still don't know what you mean bij 'columns with the dimensions'... I would interpret that as something like this:
A1 - ProductID
A2 - Long integer
B1 - Product Name
B2 - Char(255)
etc.
I'm sure that's not what you mean...
 
I started off with an excel sheet giving an overview of certain deliverables these deliverables had some dimensions like for to which product they applied to, the date, the region.
In access I would like to keep only the deliverables in the fact table with each time an ID/Key linking the result to a certain product, time, region. These dimensions should each have their own table with the ID/key, the corresponding Region or Product.
Original ___________ fact table ______ Dimension Table
A1: product___ A1: Product ID ---- A1: product ID
A2: Varchar
B1:Region ---> B1: Region ID_and__B1: Product Name
B2:Varchar
C1:Result ____ C1: Result ____ C1: Product Info
C2:Number
 
Laatst bewerkt:
en waarom gaan wij hier in het Engels helpen.
Helpmij.nl is een Nederlands forum.
De voertaal is Nederlands dus ...
gaan we nu verder met de Nederlandse taal.
 
Het spijt me indien de taal van deze post u dergelijk voor het hoofd stoot. Persoonlijk zie ik meertaligheid niet als een hindernis als wel, en eerst en vooral, als een rijdom. Vooral in een sector als informatica waar schrijftaal en programmeertalen vloeiend door elkaar stromen.
 
Er is niemand die voor het hoofd wordt gestoten. Zo zijn hier de regels en daar heeft een ieder zich aan te houden. Er zijn meerdere leden, u bent niet de enige.
 
Kijk, blijkt TS het Nederlands toch machtig :) Ik ben het met moderator en bestuurslid eens dat je in beginsel op een Nederlands forum in het Nederlands communiceert. Ongeacht of informatica en programmeertalen op het Engels zijn gebaseerd of niet. De reden dat ik in het Engels antwoordde was omdat ik ervan uit ging dat een TS die een vraag in een andere taal stelt, het Nederlands niet of slecht beheerst. Niet omdat ik zo nodig mijn talenrijkdom wil etaleren... Bovendien vind ik dat onze mooie taal in het taalgebruik al genoeg in het verdomhoekje wordt geschoven. Nederlands dus svp!
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan