Results 1 to 5 of 5
  1. #1
    mlandis is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    2

    Help to write query?

    Hello-
    I have a table that includes student grades. Every line of the table includes the students name, a course ID, and grade. There is a row in the table for each course the student is taking so each student can have up to 10 lines in the table. I need to somehow write a query that will merge each student's data into one line--basically group by the student name and then show all of the courses they are taking appear to the right on the same line. Does anyone know how I can write a query to do this?

    I am using Access 2007.

    Thank you!!



    Meg

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    I do not know how to do this in a query but I DO know how to do this using VBA Code.
    Does your solution HAVE to be in a query?

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Can you tell us about the other Tables?

    Do you have tables along these lines: (there may be others and additional fields)

    Student
    StudentId (PK)
    Studentname

    Course
    CourseId (PK)
    CourseName

    Grade

    GradeId (PK)
    StudentId (FK) 'student
    CourseID (FK) ' course
    Grade

  4. #4
    mlandis is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    2
    Hi - So sorry to bug you, but I am still trying to work on this...are you able to share what your solution would be using VBA code? I would greatly appreciate it!!!
    Thank you!

  5. #5
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Hi mlandis!
    Take a look at this:
    http://allenbrowne.com/func-concat.html
    . . . it might help you get what you need.

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

Similar Threads

  1. vba to write a record
    By ccordner in forum Forms
    Replies: 1
    Last Post: 02-08-2012, 10:08 AM
  2. How To Write Vb Code For This?
    By townguy in forum Queries
    Replies: 1
    Last Post: 09-15-2011, 12:00 AM
  3. How Do I Write This Query?
    By TxTcher in forum Forms
    Replies: 8
    Last Post: 08-13-2010, 01:50 PM
  4. How would I write this query?
    By tigers in forum Queries
    Replies: 1
    Last Post: 02-08-2010, 08:29 AM
  5. write a query how to???
    By flamingo in forum Queries
    Replies: 0
    Last Post: 01-13-2009, 03:57 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