Skip to content
Advertisement

Unpivot Data Using MS Access Query

Hoping someone with Access & SQL experience would be able to write some SQL code that I could use in MS Access to transform/unpivot some data. I’ve spent a day trying advise from others who have asked similar questions here, but I have no SQL experience and have failed miserably so far.

Image

Advertisement

Answer

You can use union all to unpivot in access:

select item, 'A' as period, a as forecast from tbl_weekly_forecast
union all select item, 'B', b from tbl_weekly_forecast
union all select item, 'C', c from tbl_weekly_forecast
union all select item, 'D', d from tbl_weekly_forecast
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement