Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8249661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:37:13+00:00 2026-06-07T23:37:13+00:00

I have an Access database that looks something like this: ID | TestDate |

  • 0

I have an Access database that looks something like this:

ID     |   TestDate   |  Test1  |  Test2  |  Test 3  |
1      |    Date1     |   10    |    20   |    25    |
1      |    Date2     |   8     |    21   |    23    |
1      |    Date3     |   9     |    18   |    23    |
2      |    Date1     |   13    |    19   |    22    |

I wanted to transpose the row data to columns and maintain the name of the previous column headings, like so:

ID = 1
       |   Date1   |  Date2  |  Date3  |   etc...
Test1  |    10     |    8    |    3    |
Test2  |    20     |   21    |   18    |
Test3  |    25     |   23    |   23    |

ID = 2
       |   Date1   |
Test1  |    13     |
Test2  |    19     |
Test3  |    22     |


*The Date1 in the different IDs need not be the same. Date1 is the date the ID 
 had the Test for the first time. 

This way it will be easier to monitor the trend of the test values. I tried looking but the queries I stumble upon add values. I just need the data transposed without having to copy and paste into excel. Any MS Access query or VBA code is much appreciated. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T23:37:14+00:00Added an answer on June 7, 2026 at 11:37 pm

    How about:

    TRANSFORM SUM(q.testval) AS sumoftestval
    SELECT q.id,
           q.test
    FROM   (SELECT t2.id,
                   t2.testdate,
                   "test1"  AS Test,
                   t2.test1 AS TestVal
            FROM   t2
            UNION ALL
            SELECT t2.id,
                   t2.testdate,
                   "test2"  AS Test,
                   t2.test2 AS TestVal
            FROM   t2
            UNION ALL
            SELECT t2.id,
                   t2.testdate,
                   "test3"  AS Test,
                   t2.test3 AS TestVal
            FROM   t2) AS q
    GROUP  BY q.id,
              q.test
    PIVOT q.testdate; 
    

    Select an ID

    TRANSFORM Sum(q.testval) AS sumoftestval
    SELECT q.test
    FROM (SELECT t2.id,
                   t2.testdate,
                   "test1"  AS Test,
                   t2.test1 AS TestVal
            FROM   t2
            UNION ALL
            SELECT t2.id,
                   t2.testdate,
                   "test2"  AS Test,
                   t2.test2 AS TestVal
            FROM   t2
            UNION ALL
            SELECT t2.id,
                   t2.testdate,
                   "test3"  AS Test,
                   t2.test3 AS TestVal
            FROM   t2)  AS q
    WHERE q.id=1
    GROUP BY q.test
    PIVOT q.testdate;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application config file that looks something like this: database: type: [db-type]
so I have this problem. My Database has two tables that look something like
I have a table that looks something like this: pageload --pageloadid (autoincrementing numeric id
I have an C# form application that use an access database. This application works
I have something that looks like the following document structure: public class Document {
I have a legacy SQL schema which looks something like this: CREATE TABLE `User`
I have Hibernate Entities that look something like this (getters and setters left out):
I have an Access 2007 database that works asynchronously with a MAS200 database. Due
I have a ms access database that has one table for each photo album
Just need some quick clarification I have 2 Queries in my Access Database that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.