Results 1 to 3 of 3
  1. #1
    Philip is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2018
    Posts
    2

    Using a query to merge data from two tables in a specific layout

    Hi all, this is my first post so I hope I am observing all protocols.

    I need to extract data from two tables and present the data in a specific format. The first table, named VSS_Initial_Extract, has personal student data and the programmes they registered for per year. There are 4089 records in this table with 45 fields each. The other table carries the grades for each module the students registered for. There are 31783 records in this table, named VSS_StudyRecord. There are 9 fields in this table. The simple query I run generates 31783 records, with 52 fields, but I need 4089 records, only with more fields so each module's details are recorded next to each student in the year they registered for them (each student registered for a different number of modules in different years). We are transferring the data from one database to another, so there is no worry about the grades changing. The old system will become redundant once the details are transferred. Here is a sample of what I have and then what I need (this is for only one student, but I need to do this for all students. I've also heavily edited so as to give an example):

    What I get:
    StudentNumber VSSCourseCode LevelCode VSSModuleCode Grade Method of Delivery Presentation Mode Symbol
    22009 CHR 3 30 74 1 1 B
    22009 CHR 3 29 78 1 1 A
    22009 LEA 3 1 84 1 1 A
    22009 BIB 3 10 80 1 1 A
    22009 CHR 3 15 76 1 1 A
    22009 CHR 2 2 74 1 1 B
    22009 CHR 3 23 80 1 1 A
    22009 BIB 3 11 81 1 1 A
    22009 BIB 3 12 74 1 1 B
    22009 BIB 3 8 73 1 1 B
    22009 CHR 3 19 1 1 AU
    22009 CHR 3 16 82 1 1 A
    22009 BIB 3 4 78 1 1 A
    22009 BIB 3 5 84 1 1 A

    What I need:
    StudentNumber VSSCourseCode LevelCode VSSModuleCode Grade Method of Delivery Presentation Mode Symbol VSSCourseCode LevelCode VSSModuleCode Grade Method of Delivery Presentation Mode Symbol VSSCourseCode LevelCode VSSModuleCode Grade Method of Delivery Presentation Mode Symbol VSSCourseCode LevelCode VSSModuleCode Grade Method of Delivery Presentation Mode Symbol VSSCourseCode LevelCode VSSModuleCode Grade Method of Delivery Presentation Mode Symbol VSSCourseCode LevelCode VSSModuleCode Grade Method of Delivery Presentation Mode Symbol VSSCourseCode LevelCode VSSModuleCode Grade Method of Delivery Presentation Mode Symbol
    22009 CHR 3 30 74 1 1 B CHR 3 29 78 1 1 A LEA 3 1 84 1 1 A BIB 3 10 80 1 1 A CHR 3 15 76 1 1 A CHR 2 2 74 1 1 B CHR 3 23 80 1 1 A

    Where do I start? I'm not great with SQL and tend to use the builder in Access, but if I need to get technical, I can for this one Query.

    Cheers


    Philip

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    a report can do this,
    set the report to 3 columns (down then right)

    tho this is a very awkward way to do it ,(and is not very readable), when a report can print vertically with zero effort.

  3. #3
    Philip is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2018
    Posts
    2
    Hi Ranman256

    You'll need to give me more guidance on Reports as I've never worked with those. I've tried the Report Wizard and it said I have chosen too many fields. Also, can reports export into Excel/CSV as I need the data in that format in order to be imported into the new database. Remember, this query will have at least 160 fields when it is working properly.

    Kind regards
    Philip

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

Similar Threads

  1. Replies: 2
    Last Post: 12-13-2017, 06:48 AM
  2. Merge Data Tables
    By topcat10 in forum Queries
    Replies: 8
    Last Post: 08-07-2015, 12:24 PM
  3. Replies: 11
    Last Post: 01-07-2015, 06:12 AM
  4. Change the layout of the data in my query
    By Carla C in forum Queries
    Replies: 9
    Last Post: 07-13-2012, 08:42 AM
  5. Mail Merge w/ data from 2 tables
    By sedain121 in forum Import/Export Data
    Replies: 3
    Last Post: 06-30-2010, 09:43 AM

Tags for this Thread

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