Results 1 to 3 of 3
  1. #1
    greggue is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    12

    Access Report

    Hello to everyone,
    The formating of this post maybe off so here's a word attachement.

    I am trying to create an access report that would group by number of course taken (3 max) and show which course(s) was taken in the columns next to the records as follow:
    Detroit
    New York
    Miami
    Group by 3
    Night, Jennifer
    c1
    c1
    c1
    Group by 2
    Smith, John
    c1
    c1
    Doug, Youlog
    c1
    c1
    Group by 1
    Luther, Travis
    c1


    Here’s an example of the recordset returned by the query that pulls the data.
    Course
    LastName
    FirstName
    C_ID
    C1 Detroit
    Smith
    John


    111
    C1 New York
    Smith
    John
    111
    C1 Detroit
    Night
    Jennifer
    555
    C1 New York
    Night
    Jennifer
    555
    C1 Miami
    Night
    Jennifer
    555
    C1 Detroit
    Luther
    Travis
    888
    C1 Miami
    Doug
    Youlog
    999
    C1 Detroit
    Doug
    Youlog
    999


    Help

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,948
    Required a series of queries.

    CourseCount
    SELECT [LastName] & ", " & [FirstName] AS StudentName, Count(Table3.C_ID) AS CountOfCourse
    FROM Table3
    GROUP BY [LastName] & ", " & [FirstName];

    Query1
    SELECT Left([Course],2) AS Code, Mid([Course],3) AS City, [LastName] & ", " & [FirstName] AS StudentName, Table3.C_ID
    FROM Table3;

    Query2
    SELECT Query1.Code, Query1.City, Query1.StudentName, CourseCount.CountOfCourse, Query1.C_ID
    FROM Query1 INNER JOIN CourseCount ON Query1.StudentName = CourseCount.StudentName;

    Crosstab query
    TRANSFORM First(Query2.[Code]) AS FirstOfCode
    SELECT Query2.[CountOfCourse], Query2.[StudentName]
    FROM Query2
    GROUP BY Query2.[CountOfCourse], Query2.[StudentName]
    ORDER BY Query2.[CountOfCourse] DESC , Query2.[StudentName]
    PIVOT Query2.[City];
    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
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    well - I believe that you have to make each its own crosstab report separately: Group by 3, Group by 2, Group by 1. 3 different reports - and then use one unbound report to hold these three as subreports.

    its a bit of work. I'm not a fan of crosstab displays because of that point.

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

Similar Threads

  1. Replies: 4
    Last Post: 12-13-2010, 05:33 PM
  2. Replies: 2
    Last Post: 08-25-2010, 01:42 PM
  3. Replies: 3
    Last Post: 05-21-2010, 03:57 PM
  4. Access Report
    By gpranjan in forum Reports
    Replies: 0
    Last Post: 12-28-2009, 10:50 AM
  5. PDF used in Access Report
    By jsh in forum Forms
    Replies: 2
    Last Post: 04-06-2009, 12:25 PM

Tags for this Thread

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