Joining records for a report

MarkP

Registered User.
Local time
Today, 03:59
Joined
Jun 13, 2003
Messages
15
I need help printing two records on a single line

ClassName Semester Grade

Biology F A
Biology S B

What I want is to join the two records in a transcript report
so that it shows up like this

Biology F/S A/B

I can't change the database tables because I get the data
from the internet so is their a way that I can Join the
records together in the report
I will have 4-8 classes per semester
 
This is possible using a self-join query on the original data table. Try this query:
SELECT First(tblGrades.ClassName) AS Class, First([tblGrades].[Semester] & "/" & [tblGrades_1].[Semester]) AS Semesters, First([tblGrades].[Grade] & "/" & [tblGrades_1].[Grade]) AS Grades FROM tblGrades INNER JOIN tblGrades AS tblGrades_1 ON tblGrades.ClassName=tblGrades_1.ClassName;

This assumes your original data table is called tblGrades.

To use this code, create a new query, but do not add any tables to it. On the View menu, choose SQL View, copy and paste the above code starting with the work "SELECT" and up to and including the final semicolon. Click on the exclamantion point icon (!) to run the query and see if it works.

If it works for you, save this query and use it as the recordsource for your report.
 
Attached is a piciture of the query in design mode.
 

Attachments

  • qryexample.jpg
    qryexample.jpg
    54.9 KB · Views: 124
Still need help

These are good suggestion and I tried to make it work but I am still having a probelm. I have attached a zip file with a sample of what I am working with and a txt file with some directions to show you what I have been doing. I have talked with several sql programmers and no one can make it work for me. Please help
 

Users who are viewing this thread

Back
Top Bottom