Converting Query Record Source to Columns in a report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jglabas
    New Member
    • Jun 2008
    • 9

    Converting Query Record Source to Columns in a report

    For a report, I am using a query as my record source. The query produces 5 columns by 3272 records.

    The data in columns 1 & 2 (“Objective” and “Rating”) repeats every 409 records The data for “initial” and “Date” are unique for the individual. Currently there are 8 individuals (409 * 8 = 3272)


    . . . . .. . . . .Objective . . . Rating . . Initial . . . .. Date . . . . . Name
    [rec0001]. . . . .abc. . . . . . .a. . . . . . jg. . . . . .1/12/07 . . . . .Bob


    [rec0409]. . . . .xyz. . . . . . .f. . . . . . mc. . . . . .6/30/08 . . . . . Bob
    [rec0410]. . . . .abc. . . . . . .b. . . . . . dt. . . . . .4/15/08 . . . . . Jim



    [rec3272]. . . . .xyz. . . . . . .c. . . . . . do. . . . . .7/15/08 . . . . . Steve



    I would like the report to display these records as

    Heading. . . . . . . . . . . . . . . . . . . . . Bob. . . . . . . . . . Jim. . . . . . . . . . . . . . . Steve
    . . . . . . . . . . Obj . . Rating. . . . Initial . . Date. . . . Initial . . Date. . . -> . . .Initial . . Date
    . . . . . . . . . . ------ . ---------. . . ------- . -------- . . . . ------- --------- . . . . . . . ------- . ---------
    [rec0001] . . . abc . . . a . . . . . . jg . . 1/12/07 . . . . dt . . 4/15/08 . . . . . . . df . . 1/21/06


    [rec0409] . . . xyz . . . f . . . . . . mc . . 6/30/08 . . . . br . . 3/31/07 . . . . . . . se . . 9/23/08

    When using the original query, I get a 72 Page report rather than the desired 11 page report. I am uncertain whether to do this as another query, a recordset in the detail_Print(), an array, or what. Any suggestions on how to limit the first three columns to 409, while place the remaining, non-repeating data in additional columns? Not even sure which would be the best approach to this in order to research it. Any assistance/direction is appreciated in advance.
  • hjozinovic
    New Member
    • Oct 2007
    • 167

    #2
    Hi!

    It looks like you could use crosstab query for this.
    Try to make a CQ that has Name as Column.
    That way you will get one column for every Name (john; steve;...8th person)

    After you that try to make a new Select query combining the data from CQ with the query containing the rest of the data.

    Also you can refer to help in Access to understand more about Crosstab queries...

    Best,
    H.

    Comment

    Working...