Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / July 2006

Tip: Looking for answers? Try searching our database.

Union query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
f2rox - 20 Jul 2006 21:30 GMT
I am using the following SQL statement which i found elsewhere on this site):
> SELECT NAME, Grade1 AS GRADE FROM tblStudentGrades
> UNION
> SELECT NAME, Grade2 AS GRADE FROM tblStudentGrades
> UNION
> SELECT NAME, Grade3 AS GRADE FROM tblStudentGrades
> UNION
> SELECT NAME, Grade4 AS GRADE FROM tblStudentGrades;

This makes a query that looks like this:
NAME                     GRADE
Student 1                70
Student 1                78
Student 1                80
Student 1                65
Student 2                81
Student 2                85
Student 2                80
etc., etc.
My problem with this is that if a student has the same grade twice, it will
only be listed once.  Is there any way to modify this so that each grade is
listed, even if the student has more than one of the same grade?
Amy Blankenship - 20 Jul 2006 21:43 GMT
Try UNION ALL.

HTH;

Amy

>I am using the following SQL statement which i found elsewhere on this
>site):
[quoted text clipped - 21 lines]
> is
> listed, even if the student has more than one of the same grade?
f2rox - 20 Jul 2006 22:46 GMT
I will try that, thank you very much

> Try UNION ALL.
>
[quoted text clipped - 27 lines]
> > is
> > listed, even if the student has more than one of the same grade?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.