Results 1 to 5 of 5
  1. #1
    Jaron is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    63

    How do I combine Crosstab results into one row?

    Hi, I have a crosstab that converts the following:



    Date Name Amount
    5/1/12 Smith 5
    5/2/12 Smith 3




    into:

    Name 5/1/12 5/2/12
    Smith 5
    Smith 3




    Is there any way to get this instead:

    Name 5/1/12 5/2/12
    Smith 5 3



    ...by somehow combining the rows from the crosstab results?

    Thanks for any help

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Try using the crosstab as source for an Aggregate GROUP BY (Totals) query.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    Jul 2011
    Posts
    17
    It should do that automatically. That's what the "Group By" means in the "Crosstab" for the Name field. If not, it thinks the two Smiths are different. Does your query have any other fields? Are there possibly spaces (that you can't see) following some of the Smiths and not others? Can you provide the actual SQL?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Doh! Good point friendlyfriend, I should have caught that. However, Access drops spaces at the end of string data in fields so maybe some other issue.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Jaron is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    63
    Ok, thanks to both of you. I first did the aggregate query, which worked, then I saw the second response and changed the appropriate 'group by' to 'sum', which works good. Very simple.

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

Similar Threads

  1. Replies: 3
    Last Post: 09-04-2013, 03:21 PM
  2. Combine Results of Two Queries
    By Ganymede in forum Queries
    Replies: 3
    Last Post: 12-28-2012, 02:00 PM
  3. Combine two crosstab queries
    By Ray67 in forum Queries
    Replies: 2
    Last Post: 10-18-2012, 01:24 PM
  4. Replies: 5
    Last Post: 08-29-2011, 09:37 AM
  5. Combine crosstab queries
    By thart21 in forum Queries
    Replies: 3
    Last Post: 05-03-2010, 10:36 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