Hi all. Was wondering if any of you could help me with some MS Access VBA code containing an SQL statement.
I am trying to copy rows of data from an import table which is in a short-fat structure, and paste them into my new Master table which is in a long thin structure. In my import table, I have weekly data going across the database and I am trying to automate an append query to add the weekly data to my master table, one week underneath the other.
For now I have been manually creating append queries (first 5 weeks) but would like an automatic way (hopefully through VBA code) to add the other weeks of the year.
Here is my SQL view of my append queries I have been using so far:
INSERT INTO [Master Data] ( [Group], Parameter, [Actual OR Target], Units, [Value], [Year-Week], Area, Site )
SELECT [2009 Import Table].[Group], [2009 Import Table].[Parameter], [2009 Import Table].[Actual OR Target], [2009 Import Table].[Units], [2009 Import Table].[2009-Wk05] AS [Value], "2009-Wk05" AS [Year-Week], "Sinter Plant" AS Area, "Port Talbot" AS Site
FROM [2009 Import Table];
If any of you have the time or know of how to add 2009-Wk06 all the way to 2009-Wk06, I'd be very grateful.
Thanks guys!
Adam