Results 1 to 2 of 2
  1. #1
    jpkeller55 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    169

    Crosstab query where column value is text from a field in the row

    I am sure this is doable, but can't figure it out. I am trying to write a crosstab query which will take data from a table in this format:


    Name InsurSeq InsurName
    Bill 1 BCBS-IL
    Bill 2 Cigna
    Bill 3 Medicaid
    Dave 1 Aetna
    Dave 2 Medicare
    Sue 1 Cigna
    Sue 2 Aetna
    Sue 3 Medicare













    And put the data in this format:
    Name 1 2 3
    Bill BCBS-IL Cigna Medicaid
    Dave Aetna Medicare
    Sue Cigna Aetna Medicare







    Any help would be greatly appreciated. Thanks

  2. #2
    jpkeller55 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    169
    Figured it out on my own:

    TRANSFORM First(Table1.InsurName) AS FirstOfInsurName
    SELECT Table1.Name
    FROM Table1
    GROUP BY Table1.Name
    PIVOT Table1.InsurSeq;

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 02-21-2012, 10:15 AM
  2. Replies: 1
    Last Post: 02-03-2012, 05:39 PM
  3. Crosstab Query - Column differences conflict
    By JoshZulaica in forum Queries
    Replies: 1
    Last Post: 06-23-2011, 01:43 AM
  4. Replies: 20
    Last Post: 02-14-2011, 10:55 AM
  5. Replies: 5
    Last Post: 09-10-2010, 10:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums