Results 1 to 4 of 4
  1. #1
    tweetyksc is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    2

    GROUP numerous lines to one record

    I have a table from our system that has numerous lines per student that I'm trying to "roll up" to have a flat file with student id and the relating data in columns per id, instead of an id with multiple lines.

    ex: Current table


    ID------field name--- String_value
    12345--TownofBirth--Bloomfield
    12345--Grade--------5
    12345--EnterDate----05/16/2009

    I'd like to have a resulting query that lists for example:
    ID-----TownofBirth----Grade---EnterDate
    12345--Bloomfield------- 5-----05/16/2009

    I can easily create the fields using the query using iif statement
    ex: StateID: IIf([FIELD_NAME] Like "CT_State_Student_ID",[String_VALUE],Null) for the numerous fields; now am trying to get it to appear on one line in a group...just can't get it...

    I was able to do it with one of the tables where I didn't need to return the actual data from the table...in that instance it was a list of race codes, multiple lines per student if more than one - it was easy enough to create a field for each race, assign it "1" if populated, 0 if not, and then count in an aggregate query...everything on one line real nice. But in this table, I need actual values...I don't know if I'm rusty and this is something that should be simple...or what

  2. #2
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    Hi Tweety,

    If you are certain that there is only one entry of "field name" per ID, then you might try using a crosstab query (just use "First" as the aggragate function for the Value).

    Cheers,

  3. #3
    tweetyksc is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    2

    "first"

    That didn't work - it is returning a list of one line per student, but not including all the data in the accompanying lines.

    Yes there is only one line, per student id, for each unique "field name" data content (ex: Student 1234 would only have one line for "field Name" = grade, but may have numerous lines in the table for other field names. I'm grouping on what I know is the same - ID, Name, but calculating the fieldnames to create a column name and the content. Now just need it in a flat file per student id...

  4. #4
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    Perhaps I'm not understanding you, are you saying this doesn't work?

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

Similar Threads

  1. Report printing unknown blank lines.
    By dgrzalja in forum Reports
    Replies: 10
    Last Post: 11-02-2009, 12:21 PM
  2. columns for group detail but not group header?
    By Coolpapabell in forum Reports
    Replies: 0
    Last Post: 08-21-2009, 08:53 AM
  3. Multiple lines per record: Report?
    By cjbuechler in forum Queries
    Replies: 7
    Last Post: 07-30-2009, 08:32 AM
  4. Replies: 3
    Last Post: 10-23-2008, 08:43 AM
  5. Duplicating lines in an invoice report
    By GordonEdinburgh in forum Forms
    Replies: 0
    Last Post: 04-21-2007, 12:20 PM

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