Results 1 to 4 of 4
  1. #1
    Duncan is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Oct 2010
    Posts
    71

    Date data manipulation


    I have a set of attendance course dates that are spread out over a few years and I want to produce a report that has the months Jan-Dec across the top (column) and the years 2009-2012 down the side (row) the a count of people attending during that month for the data. Currently I’m not quite sure how to get the data using a query into a manageable format for the report.
    I’m playing with a crosstab query. I have created two tables one with the years (2009-2012) to represent the Rows and a table with the months (Jan-Dec) to represent the columns. When I use the table with the dates in it the data goes all haywire.
    Am I on the right track or have I completely missed the mark.

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Just check out, if below gives some guidelines :

    qryCourseAttendees
    Code:
    SELECT 
        tblCourseAttendees.CourseDate, 
        Year([CourseDate]) AS TheYear, 
        Month([CourseDate]) AS TheMonth, 
        tblCourseAttendees.CountOfAttendees
    FROM 
        tblCourseAttendees;

    The CrossTab Query :
    Code:
    TRANSFORM Max(qryCourseAttendees.CountOfAttendees) AS MaxOfCountOfAttendees
    SELECT qryCourseAttendees.TheYear
    FROM qryCourseAttendees
    GROUP BY qryCourseAttendees.TheYear
    PIVOT qryCourseAttendees.TheMonth;
    Thanks

  3. #3
    Duncan is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Oct 2010
    Posts
    71
    Thanks. It worked perfectly first time.

  4. #4
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Glad you found it helpful.

    Thanks

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

Similar Threads

  1. Access DATA Manipulation issue
    By humanmaycry in forum Access
    Replies: 2
    Last Post: 07-25-2011, 08:28 PM
  2. Form output data manipulation
    By bearsgone in forum Forms
    Replies: 1
    Last Post: 04-05-2011, 04:21 PM
  3. date manipulation
    By lpsd in forum Access
    Replies: 3
    Last Post: 12-23-2010, 12:06 PM
  4. Form Manipulation examples
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-24-2010, 12:03 AM
  5. Query manipulation using VBA
    By benattal in forum Programming
    Replies: 0
    Last Post: 12-31-2008, 09:12 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