I am getting the data from the Excel sheet on monthly , need to import data into the Access table as same as excel sheet. Then I need to transform the Access table (Input table) into the Normal Access table( Output table)…
Kindly provide suggestions
- how to create a dynamic input table in the access ..since new column can add or remove in the excel sheet (ex :201211)
- How to convert input table into Output table in the access.
Input Table : ( Column name : Product | Location | 201209 | 201210 )
Product | Location | 201209 | 201210
X | DK | 10 | 12
y | DK | 10 | 12
Output table :
Product | Location | Date | Quantity
X | DK |201209 | 10
X | DK |201209 | 12
Y | DK |201210 | 10
Y | DK |201210 | 12
My input table contains more columns ( ex : 201208 , 201209, 201210 ……. 201402)
You could get your desired output from a query like this:
You mentioned that your column names could change. You could get around this by creating a VBA subroutine which would look at the TableDef, and construct a SQL query for all the columns which would then insert records into a table.