Avatar of AndyC1000
AndyC1000 asked on

Query to change format of table - field value to columns (new fields)

Dear all,

I have a table in the below format:

M      Y      District      Role      CountOfRole
1      2010      18      Admin      1
1      2010      19      IT      1
2      2010      18      Admin      2
2      2010      19      IT      1


I need to change the format to:

M      Y      District      Admin      IT
1      2010      18      2      1
2      2010      19      1      1

Is this possible in a query? Apologies for the alignment of example data.
Microsoft Access

Avatar of undefined
Last Comment
Sharath S

8/22/2022 - Mon
SOLUTION
Deepak Lakkad

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
AndyC1000

Could you provide an example?
ASKER
AndyC1000

I've tried to use the cross tab query wizard, the issue I'm having is at the 'what number do you want calculated for each column and row intersection.  I've selected the field 'CountOfRole' and I'm not sure which option to select - avg, count, var, first etc.
ASKER CERTIFIED SOLUTION
Sharath S

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy