Skip to content
Advertisement

Unpivot Access Data Table

Good afternoon,

I would like to unpivot an Access Table. I have almost one hundred of columns in Access and one column with the ID and I would like to unpivot, considering all the columns except de ID into one column called “type” (for example).

enter image description here

How could I get it from Access? It doesnt matter if is by a SQL query or VBA.

Thank you in advanced.

Advertisement

Answer

It seems that the approaches with SELECT ... do not work for the OP one could try to do it with “stupid” code. Let’s assume you have the tables tblSource and tblTarget where tblTarget has the fields ID, type and val and ID is the first field in tblSource. Then the following code will “unpivot” the data

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement