Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1115
  • Last Modified:

How to transpose an Access table exchanging fields and records

I have a table with less than 7 records and 10 fields.
For the purpose of making a report I want to transpose this table so that the records become fields and the fields become records.
Below I insert a picture from Excel to show exactly what I mean. Table 1 being the original and the Table 2 the required result.
I also attach a database with the  specific original table.
(I want to point out that this simple table is an extraction from a much larger table and not a once off situation.)
Demonstration of the intention.tblPromCom.accdb
0
Fritz Paul
Asked:
Fritz Paul
  • 2
  • 2
  • 2
  • +1
1 Solution
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
You want to base the report on a cross tab query in Access, which is TRANSFORM in SQL.

Jim.
0
 
Rey Obrero (Capricorn1)Commented:
run the sub TransposeTable from the sample db
tblPromCom-rev.accdb
0
 
PatHartmanCommented:
@Rey,
I seem to have lost the ability to download database files.  I wrote to help for the site and they don't have the answer.  Are you able to download?  Do you have any idea what might be the problem?
Thanks,
Pat
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
Fritz PaulAuthor Commented:
Hi Rey,
That works fine although I would like to keep the [Agreements] in text format. Is there a way to do that?
Fritz
0
 
Rey Obrero (Capricorn1)Commented:
<I would like to keep the [Agreements] in text format.>

you can create a query that converts the fields to Text

select cstr([fieldname])
from tablex
0
 
PatHartmanCommented:
@Jim,
I added ee to my trusted sites list and that hosed everything.  I couldn't even get back to this thread.  I pressed the link from my email and the site didn't automatically log me on.  So I logged on but then the page I was on was something I've never seen before and there wasn't any way for me to get to even this section of the list.  Plus, every time I changed pages, I got a warning about going to a trusted site.  So, ee is no longer trusted.  But, I'm having the problem on three of the computers I use and I didn't change any settings.  It is probably an update to IE that is causing the problem so I'll see if I can get here using Chrome or something else.
Thanks
0
 
Fritz PaulAuthor Commented:
Thanks.
Thanks also to Jim, who I believe also gave an excellent answer. I will however follow that up later. It will take me some time.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now