Manipulate data

RishiSingh05
RishiSingh05 used Ask the Experts™
on
In the attached file, Sheet1 shows how my data is currently laid out.  I would like to change the layout to how it is shown in Sheet2.  In Sheet2 the sequence of the rows does not matter.  

Can this be done in MS Access?

Note that the data in my "real" file has a lot more rows and columns of data than the sample data in the attached file. Thanks.  
EE01.xlsx
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Database Administrator
Commented:
Hi,

If you have only 50 states it won't look pretty, but is doable I believe

select prodname, tiers, CA as rate, 'CA' as state

union all

select prodname, tiers, NC as rate, 'NC' as state
 
...

What you are trying to do is unpivot sheet1 to a normallised sheet2. SQL 2005 introduced the pivot and unpivot operators, but not sure about access.

Regards
  David

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial