Results 1 to 3 of 3
  1. #1
    Deutz is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2010
    Posts
    51

    Crosstab query

    Hi and thanks in advance,

    I'm using Access 2003.

    I'm trying to formulate a crosstab query and having a bit of difficulty.

    I have a table with fields: Owner, Area & Status

    Data looks like:

    OwnerAreaStatusJackArea1RedJackArea5RedJackArea3GreenJackArea2AmberJackArea6AmberBillArea9RedBillArea8RedBillArea4GreenBillArea7GreenBillArea10GreenTonyArea11RedTonyArea12Amber

    An Area can only belong to a single Owner.

    I'm trying to produce a query to rearrange the data for a report where data will be displayed as

    OwnerRedGreenAmberJackArea1Area3Area2Area5Area6BillArea9Area4Area8Area7Area10TonyArea11Area12


    My SQL works to some extent as it puts a 1 into the Red Green and Amber cols but not the Area itself ...

    TRANSFORM Count(Data.[Area]) AS [CountOfArea]
    SELECT Data.[Owner], Data.[Area]
    FROM Data
    GROUP BY Data.[Owner], Data.[Area]


    PIVOT Data.Status;


    Thanks
    Deutz

  2. #2
    Deutz is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2010
    Posts
    51
    Sorry about the long lines of data.

    I foolishly thought I could copy from Excel cells into the post.

    I'll see what I can do to reformat it and post again

  3. #3
    Deutz is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2010
    Posts
    51
    My data is stored in a single table like this:

    Owner.....Area.......Status
    Jack.......Area1......Green
    Jack ......Area2......Amber
    Tony......Area7......Green
    Tony......Area10.....Red
    Tony......Area5.......Red
    Bill.........Area4.......Amber

    I'm trying to produce a query for a report that will look like this:

    Owner........Green........Amber.......Red....
    Jack...........Area1........Area2................
    Tony..........Area7.......................Area10
    Tony.........................................Area5
    Bill.............................Area4............ ....

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

Similar Threads

  1. Crosstab Query Bug
    By goodguy in forum Queries
    Replies: 19
    Last Post: 02-03-2011, 01:41 PM
  2. Crosstab Query Help
    By ksmith in forum Programming
    Replies: 7
    Last Post: 12-01-2010, 07:00 AM
  3. Crosstab Query
    By lukewarmbeer in forum Access
    Replies: 2
    Last Post: 08-13-2010, 05:10 AM
  4. Replies: 1
    Last Post: 07-30-2010, 10:28 AM
  5. Query - Crosstab ?
    By rob4465 in forum Access
    Replies: 1
    Last Post: 01-28-2010, 08:41 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