Results 1 to 2 of 2
  1. #1
    scoe is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    91

    Consolidate data in rows depending on Month and Organisation

    Hi, I hope someone can help... I am preparing a query for a report that is quite detailed and have produced a union query which contains the information but does not put it all in one row depending on month and organisation, I have tried various methods but nothing seems to work.... Desparate for help on this.
    orgn_name MonthDesc CINT WthT TranT EnrT CompT
    Clarity Education August 3
    Clarity Education December 7
    Clarity Education December 1
    Elite Assessors Ltd November 10
    Elite Assessors Ltd November 1
    Elite Assessors Ltd October 1


    The code is:
    [SELECT [Apps Post In Summary By Partners].orgn_name, [Apps Post In Summary By Partners].MonthDesc, Count([CIN]) AS CINT, "" AS WthT, "" AS TranT, "" AS EnrT, "" AS CompT
    FROM [Apps Post In Summary By Partners]
    WHERE ((([Apps Post In Summary By Partners].CIN)="CIN"))
    GROUP BY [Apps Post In Summary By Partners].orgn_name, [Apps Post In Summary By Partners].MonthDesc, "", "", "", "";Union
    SELECT [Apps Post In Summary By Partners].orgn_name, [Apps Post In Summary By Partners].MonthDesc, "" AS CINT, Count([Apps Post In Summary By Partners].[Withdrawals]) AS WthT, "" AS TranT, "" AS EnrT, "" AS CompT
    FROM [Apps Post In Summary By Partners]
    WHERE ((([Apps Post In Summary By Partners].Withdrawals)="Withdrawal"))
    GROUP BY [Apps Post In Summary By Partners].orgn_name, [Apps Post In Summary By Partners].MonthDesc, "", "", "", "";Union
    SELECT [Apps Post In Summary By Partners].orgn_name, [Apps Post In Summary By Partners].MonthDesc, "" AS CINT, "" AS WthT, Count([Apps Post In Summary By Partners].[Transfers]) AS TranT, "" AS EnrT, "" AS CompT
    FROM [Apps Post In Summary By Partners]
    WHERE ((([Apps Post In Summary By Partners].Transfers)="Transfer"))
    GROUP BY [Apps Post In Summary By Partners].orgn_name, [Apps Post In Summary By Partners].MonthDesc, "", "", "", ""; UNION SELECT [Apps Post In Summary By Partners].orgn_name, [Apps Post In Summary By Partners].MonthDesc, "" AS CINT, "" AS WthT, "" AS TranT, Count([Apps Post In Summary By Partners].[Enrolments]) AS EnrT, "" AS CompT
    FROM [Apps Post In Summary By Partners]
    WHERE ((([Apps Post In Summary By Partners].Enrolments)="Enrolment"))


    GROUP BY [Apps Post In Summary By Partners].orgn_name, [Apps Post In Summary By Partners].MonthDesc, "", "", "", "";]

    Any help would be gratefully appreciated

  2. #2
    scoe is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    91
    Used the union query to make a new select query and used max on all columns bar the [MonthDesc]and [orgn_name] and the report has excepted this and has consoidated the columns.

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

Similar Threads

  1. Replies: 2
    Last Post: 01-06-2014, 04:22 PM
  2. Copying rows depending on number of fields full
    By tmpgovrel in forum Queries
    Replies: 4
    Last Post: 09-03-2013, 12:11 PM
  3. Display table data depending on selected data
    By swavemeisterg in forum Forms
    Replies: 7
    Last Post: 07-30-2013, 03:43 PM
  4. consolidate data from two identical databases
    By amd711 in forum Import/Export Data
    Replies: 1
    Last Post: 11-04-2012, 12:43 AM
  5. Conducting a test within organisation
    By randenius in forum Access
    Replies: 3
    Last Post: 06-06-2012, 12:03 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